/* ═══════════════════════════════════════════════════════════════════════════
   TrendLoop Design System — tl.css
   Shared tokens, type, components, Loop Rail, motion utilities.
   Load Inter (400, 500) in the page <head>. One face, two weights.
   ═══════════════════════════════════════════════════════════════════════════ */

/* ── Tokens ──────────────────────────────────────────────────────────────── */

:root {
  /* ── Liquid minimal ────────────────────────────────────────────────────────
     Ground truth for the whole app. The reference is gooey.jakubantalik.com:
     no borders, no shadows, surfaces are translucent veils over one flat
     ground, and separation is tonal. Everything below serves that.

     rgba(217,217,217,.05) over #070707 composites to exactly #121212, which is
     why --veil and --solid are the same colour — one see-through, one not. That
     is what lets the opaque legacy tokens keep working beside the new ones. */
  /* A CONSIDERED NEUTRAL, NOT AN INHERITED ONE. This was #070707 — pure
     grey, equal parts, which on a page this size reads as flat rather than
     deep. Measured off the reference: their ground is rgb(15,17,19) and their
     panels rgb(28,30,32) — lifted off true black and biased COOL, blue a
     little above green a little above red. Two points of separation is all it
     takes for a dark page to look chosen. */
  /* OFF THE REFERENCE'S GROUND, ON PURPOSE. #0F1113 was measured off
     higgsfield.ai and matched to the digit — which was right while the job was
     "look like theirs" and is wrong now that the job is "be better than
     theirs". Their ground is cool-blue-black; this one is a true neutral
     near-black, so the warm accent below has somewhere of its own to sit. */
  --ground:   #0A0A0B;
  /* SOLID STEPS, NOT WHITE VEILS. These were translucent WHITE over a cool
     ground, and white washes the bias out — every surface drifted back toward
     neutral the moment it lifted, which is why the app read as grey-on-grey
     while the reference stays of a piece. Measured off theirs: ground
     rgb(15,17,19), panel rgb(28,30,32), lifted rgb(35,38,42), higher
     rgb(56,62,70). Each step keeps blue above green above red, so the whole
     ladder belongs to one family. Opaque also means a step over an image is
     the colour it says it is. */
  --veil:     #141416;                     /* cards, panels, rails            */
  --veil-2:   #1C1C20;                     /* buttons, chips, inputs          */
  --veil-3:   #2A2A31;                     /* hover / selected                */
  --veil-4:   #383840;                     /* pressed / on, separators        */

  /* The veils above are SURFACES — opaque, and that is the point. These four
     are the other job: a translucent film laid OVER something that must keep
     showing through. Used as linear-gradient(var(--tint-N) 0 0) above a base,
     or under a backdrop-filter. Reach for a veil when you are painting a
     surface, a tint when you are tinting one; using a veil for the second
     erases whatever it covers. */
  --tint:     rgba(255, 255, 255, 0.05);
  --tint-2:   rgba(255, 255, 255, 0.07);
  --tint-3:   rgba(255, 255, 255, 0.11);
  --tint-4:   rgba(255, 255, 255, 0.17);
  --solid:    #141416;                     /* popovers that must occlude      */
  --solid-2:  #101012;                     /* opaque control on the ground    */

  /* ── Legacy names: RE-VALUED, never renamed ────────────────────────────────
     ~1,500 var() call sites across nine pages read these. Changing what a name
     resolves to restyles all of them at once; changing the name breaks them. */
  --void:        #0A0A0B;
  --panel:       #141416;                  /* stays OPAQUE — see below        */
  --panel-2:     var(--veil-2);
  --panel-3:     var(--veil-3);
  --panel-hover: var(--veil-3);

  /* Borders are gone, but ~340 rules still say `1px solid var(--line)`. Every
     box is border-box, so DELETING those gives each one 2px more content width
     and reflows the app. Pointing the colour at transparent leaves the box
     model byte-identical and the hairline invisible. One edit, no reflow.
     Selection states that spoke only through border-color are re-carried on
     background instead — see the .on/.sel rules through the file. */
  --line:        transparent;
  --line-strong: transparent;
  --line-soft:   transparent;

  /* Theirs is #F7F7F8 — a hair off pure white and very slightly cool, which
     stops the brightest text ringing against a cool ground. 17.7:1. */
  --ink:    #F4F3F1;
  /* These two were translucent white, so muted text changed colour with
     whatever sat behind it — the same label read differently on a card than
     on the ground. Both are solid now, and both keep blue above green above
     red so they stay in the family. Measured, not assumed:
       --ink-2  5.47:1 on the ground, 4.83:1 on --panel
       --ink-3  4.92:1 on the ground, 4.34:1 on --panel
     --ink-2 is theirs exactly. --ink-3 is NOT: their quietest tier is
     rgba(255,255,255,.3), which measures 3.6:1 and fails AA for body text.
     Theirs carries marketing micro-copy; ours labels things an operator has
     to read, so this is pinned to what the old 48% white actually composited
     to rather than to their value. */
  --ink-2:  #9A9895;
  --ink-3:  #858380;
  --ink-4:  rgba(251, 251, 251, 0.38);

  /* ── THE ACCENT ────────────────────────────────────────────────────────
     Acid lime went first: #C8FF00 against their #D1FE17 was near enough that
     the app read as a copy of the thing it is competing with. Orange replaced
     it, and now blue replaces the orange — taken from the gradient in the
     reference, the bright core of it rather than a guess at a shade.

     #3C8CFF measures 6.02:1 on the ground and 5.80:1 for the dark that sits on
     it, so it is an accent that can carry text rather than only decorate.
     RATIONED exactly as before — solid fills only. */
  /* CHROME, NOT BLUE. This was #3C8CFF and it is why the app read blue: 63
     places call var(--signal), so one token was colouring every primary
     button, every active nav item, the headline accent and the focus ring.

     Polished metal instead. Slightly cool because chrome is, but a couple of
     points rather than the sixty-odd #3C8CFF carried — enough that it sits
     with the rim fringes and the background, not enough to be a hue. */
  --signal:    #C6CAD2;                    /* RATIONED: solid fills only      */
  --signal-2:  #E4E7EC;                    /* the pale end of the same light  */
  /* The dark that sits ON lime. Pure black against a cool-biased palette is
     the one hole in it; #131517 is theirs and belongs to the same family. */
  /* Ink on that chrome. It was #06101F — a near-black NAVY, correct against
     a blue fill and wrong against a grey one. Neutralised with it. */
  --on-signal: #101114;
  --ember:     #F0445A;                    /* red: failed or destroys (2026-11-17) */
  --ok:        #2ED573;
  --warn:      #FFB020;
  /* Cool-biased like the rest of the ladder, not neutral near-black. */
  --scrim:     rgba(9, 11, 13, 0.72);
  /* The canvas dot grid. Dim on purpose: it is there so panning reads
     as movement over a surface, not as decoration. Remix was drawing
     it in --panel-3, which is .11 — twice the weight of the same grid
     in the film studio, so the two boards did not look related.
     .05 turned out to be past dim and into invisible: a single dot over
     #070707 landed on #131313. .09 is about #1F1F1F — still quiet, but
     the surface is actually there. */
  --grid-dot:  rgba(255, 255, 255, 0.09);

  /* ── Type: Inter, two weights ──────────────────────────────────────────────
     Aliasing the display and mono faces retires Archivo from 56 call sites and
     JetBrains Mono from 57 without touching a rule. Everything that used mono
     did so to line up digits, so those selectors get tabular-nums instead. */
  --font-body:    "Inter", system-ui, -apple-system, sans-serif;
  --font-display: var(--font-body);
  --font-mono:    var(--font-body);

  --text-tele:    11px;
  --text-xs:      12px;
  --text-sm:      13px;
  --text-body:    15px;
  --text-h3:      15px;
  --text-h2:      22px;
  --text-h1:      22px;
  /* The UI ladder tops out at 22. A marketing hero at 22px is not minimal, it
     is broken, so the landing and login titles keep a real display size. */
  --text-display: 44px;

  --w-title: 500;
  --w-body:  400;

  /* Spacing — layout, not decoration. Unchanged. */
  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-5: 1.25rem;
  --space-6: 1.5rem;
  --space-8: 2rem;
  --space-10: 2.5rem;
  --space-12: 3rem;
  --space-16: 4rem;

  /* ── Radii: four real values behind five legacy names ──────────────────── */
  --radius-sm:   12px;
  --radius:      18px;                     /* popover / generic box           */
  --radius-lg:   20px;                     /* media                           */
  --radius-xl:   30px;                     /* card                            */
  --radius-full: 999px;
  --radius-pill: 999px;

  /* ── Motion ────────────────────────────────────────────────────────────────
     --dur must stay <= 240ms: remix.html waits exactly 240ms before redrawing
     its wires against the settled layout (see the note at remix.html:265).

     A SPRING IS A CHOICE, NOT THE DEFAULT. --ease-out used to be byte-identical
     to --ease-spring, so every one of its ~45 uses overshot its target by 4.1%
     and came back. On a transform that reads as life; on background-color it is
     the colour going PAST the one you asked for and returning, which is a flash
     on every hover. The two are different curves now, and anything that wants
     the bounce asks for --ease-spring by name.

     --ease-size has no overshoot either, for anything animating width or margin
     (a spring there clips fixed-width drawer contents at the peak). */
  --ease-out:    cubic-bezier(0.22, 1, 0.36, 1);      /* true decelerate, peak 1.000 */
  --ease-spring: cubic-bezier(0.2, 0.9, 0.25, 1.15);  /* deliberate overshoot, peak 1.041 */
  --ease-in-out: cubic-bezier(0.65, 0, 0.35, 1);      /* crisper than 0.45/0.55 */
  --ease-size:   cubic-bezier(0.22, 0.72, 0.2, 1);

  /* A SCALE, where there were five names for three values: --dur-fast and --dur
     were both 160ms and --dur-slow and --dur-morph were both 340ms, so "fast"
     bought you nothing and the tokens could not express a hierarchy. The steps
     are roughly x1.5 and each one has a job. 120ms is where it is because 86
     hand-written declarations across the app already say .12s — this makes them
     consistent instead of changing how they feel. */
  --dur-fast:    120ms;   /* hover feedback on a control */
  --dur:         180ms;   /* the default: panels, cards, menus */
  --dur-slow:    280ms;   /* something with distance to travel */
  --dur-morph:   340ms;   /* layout actually reflowing */
  --dur-reveal:  700ms;   /* a big entrance, once */

  --focus-ring: 0 0 0 2px var(--ground), 0 0 0 4px var(--signal);

  /* One soft lift, for things that genuinely float. The rest resolve to a
     valid no-op so existing box-shadow: var(--shadow) sites go quiet. */
  --shadow-sm: 0 0 0 0 rgba(0, 0, 0, 0);
  --shadow:    0 0 0 0 rgba(0, 0, 0, 0);
  --shadow-md: 0 0 0 0 rgba(0, 0, 0, 0);
  --shadow-lg: 0 22px 60px rgba(0, 0, 0, 0.55);
  --lift:      0 22px 60px rgba(0, 0, 0, 0.55);

  /* Native widgets we do not draw ourselves — the <audio> and <video>
     transports, scrollbars, date pickers, form controls — are painted light
     unless the document asks for dark. A white audio pill in the middle of a
     dark wall was the tell. index.html already declared this locally; here it
     covers every page that links this file. */
  color-scheme: dark;
}

/* ── Reset / base ────────────────────────────────────────────────────────── */

*,
*::before,
*::after {
  box-sizing: border-box;
}

/* The type scale is two weights, 400 and 500. b, strong, headings, th and
   optgroup do not get there from a stylesheet sweep — they are 700 by UA
   default and nothing in the app ever said otherwise, so they kept rendering
   bold after every declared weight had been normalised. Weight carries no
   layout or behaviour anywhere here, so this is safe to state globally. */
b, strong, h1, h2, h3, h4, h5, h6, th, optgroup {
  font-weight: var(--w-title);
}

.tl-page {
  margin: 0;
  min-height: 100dvh;
  font-family: var(--font-body);
  font-size: var(--text-body);
  line-height: 1.55;
  color: var(--ink);
  background: var(--void);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

.tl-page a {
  color: inherit;
  text-decoration: none;
}

/* A link styled as a button keeps the button's own foreground. `.tl-page a`
   above is (0,1,1) and would otherwise outrank `.tl-btn` (0,1,0), so every
   <a class="tl-btn"> inherited page ink — light text on the light primary
   fill, i.e. an invisible call to action. <button> was unaffected, which is
   why this only showed up on links. */
.tl-page a.tl-btn {
  color: var(--btn-fg);
}

/* ── Control shape ───────────────────────────────────────────────────────────
   One pill sweep for every control in the app. It is wrapped in :where() so it
   carries ZERO specificity — any page-local border-radius wins over it without
   needing an exception listed here, which is what keeps the three shapes that
   must never round safe by construction (canva's .aspbox aspect glyph, index's
   .donut ring). tl.css's own components restate the
   pill on their own rules below, so they do not depend on this layer.
   Range, file, checkbox and radio inputs are native shapes and stay out. */
:where(
    button,
    input:not([type="range"]):not([type="file"]):not([type="checkbox"]):not([type="radio"]),
    select,
    .btn,
    .chip,
    .tag,
    .pill,
    .token,
    .preset,
    .step,
    .badge,
    .tl-btn,
    .tl-chip,
    .tl-badge,
    .tl-input,
    .tl-select
  ) {
  border-radius: var(--radius-pill);
}

/* ── Tabular numerals ────────────────────────────────────────────────────────
   --font-mono aliases Inter now, so every selector that reached for a mono face
   in order to line digits up keeps the alignment through the numeric feature
   instead of through the face. */
.tl-tele,
.tl-mono,
.tl-tele-lg,
.tl-card__meta,
.tl-badge,
.tl-input--mono,
.tl-select--mono,
.tl-table th,
.tl-table .tl-num,
.tl-table .is-tele,
.tl-rail__label,
.tl-rail__count {
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum" 1;
}

/* ── Typography roles ────────────────────────────────────────────────────── */

.tl-display {
  font-family: var(--font-display);
  font-size: var(--text-display);
  font-weight: 500;
  letter-spacing: -0.035em;
  line-height: 0.95;
  color: var(--ink);
  overflow-wrap: anywhere;
  word-break: keep-all;
  hyphens: none;
}

.tl-h1 {
  font-family: var(--font-display);
  font-size: var(--text-h1);
  font-weight: 500;
  letter-spacing: -0.03em;
  line-height: 1.1;
  color: var(--ink);
}

.tl-h2 {
  font-family: var(--font-display);
  font-size: var(--text-h2);
  font-weight: 500;
  letter-spacing: -0.025em;
  line-height: 1.2;
  color: var(--ink);
}

.tl-h3 {
  font-family: var(--font-display);
  font-size: var(--text-h3);
  font-weight: 500;
  letter-spacing: -0.02em;
  line-height: 1.3;
  color: var(--ink);
}

.tl-body {
  font-family: var(--font-body);
  font-size: var(--text-body);
  font-weight: 400;
  line-height: 1.55;
  color: var(--ink-2);
}

.tl-body-strong {
  color: var(--ink);
  font-weight: 500;
}

.tl-caption {
  font-family: var(--font-body);
  font-size: var(--text-sm);
  line-height: 1.45;
  color: var(--ink-2);
}

/* Telemetry is Inter with tabular figures, not a second face. The class names
   keep their meaning — line up the digits — and lose the typeface switch. */
.tl-tele,
.tl-mono {
  font-family: var(--font-body);
  font-size: var(--text-tele);
  font-weight: var(--w-body);
  font-variant-numeric: tabular-nums;
  color: var(--ink-2);
}

.tl-tele-lg {
  font-family: var(--font-body);
  font-size: var(--text-sm);
  font-weight: var(--w-title);
  font-variant-numeric: tabular-nums;
  color: var(--ink);
}

/* ── Focus ───────────────────────────────────────────────────────────────── */

:focus {
  outline: none;
}

/* ONE INDICATOR, NOT TWO. Every focusable element was getting a 2px lime
   OUTLINE and, on top of it, `box-shadow: var(--focus-ring)` — which is itself
   `0 0 0 2px ground, 0 0 0 4px signal`. So a focused control wore two lime
   rings, 6px of them, and on something the size of the composer's prompt that
   is a slab rather than a hint. Three separate attempts in this file's history
   killed the outline and left the shadow, which is why it kept coming back.

   The ring stays for things you TAB to — that is a real accessibility need and
   removing it would strand keyboard users. It goes quiet for text fields,
   which per spec match :focus-visible even when you click them with a mouse:
   they already show a caret, so they do not need shouting at as well. That
   click is the one you kept hitting. */
:focus-visible {
  outline: 2px solid var(--signal);
  outline-offset: 2px;
  box-shadow: none;
}

.tl-btn:focus-visible,
.tl-chip:focus-visible,
button:focus-visible,
a:focus-visible,
[tabindex]:focus-visible {
  outline: 2px solid var(--signal);
  outline-offset: 2px;
  box-shadow: none;
}

/* A caret is already telling you where you are — so the ring here is quiet,
   and on a MOUSE click it is nothing at all.

   A text field matches :focus-visible even when clicked with a mouse; that is
   the spec, because the element takes keyboard input. CSS cannot tell the two
   apart on its own, so tl.js marks the root with data-pointer while the last
   thing that moved focus was a pointer, and clears it on Tab. Tab into a
   field and you get the ring. Click into one and you get the caret you
   already had. */
.tl-input:focus-visible,
.tl-select:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
[contenteditable]:focus-visible,
[contenteditable="true"]:focus {
  outline: 1.5px solid var(--ink-2);
  outline-offset: 0;
  box-shadow: none;
}

:root[data-pointer] .tl-input:focus-visible,
:root[data-pointer] .tl-select:focus-visible,
:root[data-pointer] input:focus-visible,
:root[data-pointer] select:focus-visible,
:root[data-pointer] textarea:focus-visible,
:root[data-pointer] [contenteditable]:focus-visible,
:root[data-pointer] [contenteditable="true"]:focus {
  outline: none;
}

/* ── Buttons ─────────────────────────────────────────────────────────────── */

/* Every --btn-border slot is transparent: a button is a tone, not an outline.
   The custom properties stay in place because the 1px keeps its share of the
   padding box — dropping the declaration would widen every button by 2px. */
/* ══ LIQUID GLASS ═══════════════════════════════════════════════════════════
   A control here is a piece of glass lying on the page, not a filled
   rectangle. Four things make that read, and only the first is colour:

   THE CAPSULE. Already ours — radius-pill on every button.

   THE SPECULAR RIM. The single most identifying feature of the material: a
   bright hairline that wraps the shape and is brightest along the TOP edge,
   because light falls from above. Two inset shadows do it — a strong one at
   the top, a much fainter one at the bottom — plus a ring that keeps the edge
   defined all the way round.

   THE FILM. Translucent, so the ground shows through and the control looks
   like a layer rather than a hole. rgba white over our dark ground, graded
   top-to-bottom so the surface has a direction.

   THE LIFT. A soft shadow underneath. Glass sits ON something.

   NO backdrop-filter, and that is measured rather than lazy: frosting ten
   panes over this app's animated dot field cost 181ms a frame — 6fps — because
   each one re-blurs its patch of a canvas that repaints sixty times a second
   (see the .hf-tile note in index.html). Buttons are smaller but there are far
   more of them. Every layer below is a gradient or a shadow, which the
   compositor draws for free, and the refraction that blur would add is worth
   little over a ground this dark.

   --glass-* are overridable per variant, so a filled button can keep its fill
   and still take the rim. */
:root {
  /* ── THE MATERIAL, SECOND PASS ─────────────────────────────────────────
     The first pass was a 1px hairline and a 10% film, and it read as a
     slightly lighter button rather than as glass. Looking at the reference
     again, four things were missing and three of them cost nothing:

     REFRACTION. The reference is transparent — you see the background
     THROUGH it, blurred and more saturated, and it bends at the edge. That
     needs backdrop-filter. There is no substitute and its absence is why the
     first pass could never have worked.

     A BEVEL, NOT A LINE. The rim is a band with a direction: bright at the
     top-left where the light is, fading through nothing, picking up again
     faintly at the bottom-right as bounce. One inset shadow cannot do that;
     it takes a gradient ring (see .tl-btn::before).

     INNER LUMINOSITY. The surface glows from inside, brightest off-centre
     toward the light. A radial gradient.

     THICKNESS. A dark inner shade along the bottom inside edge reads as the
     far wall of a solid piece of glass.

     The blur radius is deliberately large. Small blurs look like dirty
     plastic; it is only past ~16px that the background dissolves into colour
     and the thing reads as thick. */
  /* THE RIM IS A SPECULAR AND IT TRAVELS. Near-white along the top where the
     light is, and a real second highlight along the bottom as bounce off the
     surface underneath. The old pair was 0.55 / 0.10 — one visible edge and
     one that may as well not have been there, which reads as a stroke drawn
     round a shape rather than as a solid object catching light. */
  --glass-rim-top:    rgba(255, 255, 255, 0.92);
  --glass-rim-bottom: rgba(255, 255, 255, 0.26);
  --glass-ring:       rgba(255, 255, 255, 0.16);
  /* THE BODY IS A LENS, NOT A TINT. Halved, because the film was doing the
     work the backdrop should: laying white over the background instead of
     letting it through brightened. brightness() below is what replaces it. */
  --glass-film-top:   rgba(255, 255, 255, 0.07);
  --glass-film-bot:   rgba(255, 255, 255, 0.02);
  --glass-glow:       radial-gradient(125% 105% at 28% -10%,
                        rgba(255,255,255,0.16), rgba(255,255,255,0) 62%);
  /* THE EDGE LENS. Thick glass pools light just INSIDE its border, not only
     on the line — a soft band a few pixels deep under the top edge and a
     fainter one above the bottom. This is the single thing that separates a
     pane with a stroke on it from something with measurable thickness, and
     the first pass had none of it. Paired with the far-wall shade. */
  --glass-depth:      inset 0 7px 12px -9px rgba(255, 255, 255, 0.42),
                      inset 0 -8px 14px -10px rgba(0, 0, 0, 0.60);
  /* Pushed further, because the fill came down. A control with almost no film
     left needs its shadow to say where it is; without this the buttons stopped
     reading as objects and started reading as slightly brighter patches of
     background. */
  --glass-lift:       0 12px 34px rgba(0, 0, 0, 0.50),
                      0 4px 10px rgba(0, 0, 0, 0.38),
                      0 1px 2px rgba(0, 0, 0, 0.34);
  /* brightness() is the difference between glass and a grey window: it lifts
     what is behind rather than veiling it, which is why the film could halve.
     1.18 AND NOT MORE. At 1.45 this looked superb over the dot field and blew
     out the moment a control crossed a white product shot — the backdrop was
     already near 255, so the multiply clipped and the top edge became a hard
     white band. The bar can afford 1.7 because the only thing it is ever over
     is the ocean; a chip goes anywhere, so it gets the value that survives
     the brightest thing the app can put behind it. */
  --glass-blur:       blur(24px) saturate(138%) brightness(1.12);
}

.tl-btn {
  /* TRANSLUCENT, NOT A DARK FILL — this is what finally made it read as glass.
     --veil-2 is opaque #1C1C20, so the blur behind it had nothing to show and
     the control stayed a slightly lighter rectangle no matter how good the rim
     got. In the reference the material is PALE and you see through it: over
     blue it is blue, over orange it is orange, always a lens rather than a
     lid. A low-alpha white over the blur does that — the ground supplies the
     colour, the film supplies the light. */
  /* CLEARER, SO THE GROUND COMES THROUGH. .07 white was tuned over a flat
     dark page, where the film was the only thing making the control visible.
     Over the chrome that same film is a fog — it greys out the light moving
     underneath and the button reads as a smudge instead of as glass.

     So the fill drops and the EDGE carries the control instead: brighter rim,
     more lift. That is how a piece of glass held above a surface actually
     reads, and it is the arrangement that lets the surface show. */
  /* GLASS. Barely a film at all: the ground has to come through, and over a
     moving chrome field any real fill is a fog. What makes the control read
     is its EDGE, not its body. */
  --btn-bg: rgba(255, 255, 255, 0.022);
  --btn-fg: var(--ink);
  --btn-border: transparent;
  --btn-hover-bg: var(--veil-3);
  --btn-hover-border: transparent;
  --btn-active-bg: var(--veil);

  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  min-height: 40px;
  padding: 0.55rem 1rem;
  font-family: var(--font-body);
  font-size: var(--text-sm);
  font-weight: var(--w-title);
  line-height: 1.2;
  letter-spacing: -0.01em;
  color: var(--btn-fg);
  /* The film sits ON the variant's own colour, so a primary button keeps its
     fill and still reads as glass. */
  position: relative;
  background:
    var(--glass-glow),
    /* THE SHINE. A band of light crossing the face on hover, parked off the
       left edge the rest of the time. It is a background LAYER rather than a
       pseudo-element because both pseudos are spoken for — the glass bevel on
       ::before, the chrome rim on ::after for the blue ones. Driven by a
       REGISTERED percentage: an unregistered custom property interpolates as
       a string and would jump instead of sweeping. */
    linear-gradient(115deg,
      transparent calc(var(--shine) - 24%),
      rgba(255,255,255,.42) var(--shine),
      transparent calc(var(--shine) + 24%)),
    linear-gradient(180deg, var(--glass-film-top), var(--glass-film-bot)),
    var(--btn-bg);
  -webkit-backdrop-filter: var(--glass-blur);
  backdrop-filter: var(--glass-blur);
  border: 1px solid var(--btn-border);
  border-radius: var(--radius-pill);
  box-shadow:
    inset 0 1px 0 var(--glass-rim-top),
    inset 0 -1px 0 var(--glass-rim-bottom),
    var(--glass-depth),
    var(--glass-lift);
  cursor: pointer;
  user-select: none;
  white-space: nowrap;
  text-decoration: none;
  transition:
    --shine .62s var(--ease-out),
    background var(--dur-fast) var(--ease-out),
    color var(--dur-fast) var(--ease-out),
    transform var(--dur-fast) var(--ease-out),
    box-shadow var(--dur-fast) var(--ease-out),
    opacity var(--dur-fast) var(--ease-out);
}

/* ── THE SAME MATERIAL, AT PANEL SIZE ─────────────────────────────────────
   The controls were only half the reference. In the photos the DROPDOWN is the
   biggest piece of glass on screen — a slab you read a menu through — and the
   bar across the top is glass too. Doing the buttons and stopping made the
   app read as ordinary panels with shiny buttons on them.

   A panel is not a scaled-up button, so the numbers differ:

   MORE BLUR. A big surface shows more of what is behind it, so it needs to
   dissolve further before it stops looking like a dirty window. 40px against
   the controls' 20.

   A QUIETER RIM. At button size a bright edge reads as a bevel; at panel size
   the same brightness reads as a border someone drew on. Roughly half.

   A DEEPER SHADOW. Panels float further off the page than buttons do, and the
   shadow is most of what says so.

   Specificity again: these live in each studio's own <style> block, which
   comes after this file, so `body #pop` (1,0,1) beats their `#pop` (1,0,0)
   wherever it is written. Their own colours are still theirs.

   #settings, #assets AND #ctx WERE IN THIS LIST AND SHOULD NOT HAVE BEEN.
   I put them here by guessing from their names; all three exist in exactly one
   file, and they are not menus — they are canvas panels, floating
   over a board of the user's own artwork. They set `background: var(--panel)`,
   the one token this file annotates "stays OPAQUE", and they mean it: a panel
   that has to be readable over an arbitrary photograph cannot be glass. Made
   translucent, "Nothing yet — make one in My elements." fell from 4.87:1 to
   4.32:1 on an EMPTY board and to 1.16:1 once a bright node slid under it.
   Occlusion is the feature. */
body #pop,
body #tl-qpop,
body #im-flyout,
body #profile-menu,
body #tiermenu,
body #flyout,
body .pop,
body .popover,
body .menu {
  background:
    var(--glass-glow),
    linear-gradient(180deg, rgba(255,255,255,0.07), rgba(255,255,255,0.025)),
    rgba(20, 22, 26, 0.62);
  -webkit-backdrop-filter: blur(40px) saturate(126%);
  backdrop-filter: blur(40px) saturate(126%);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.26),
    inset 0 -1px 0 rgba(255, 255, 255, 0.05),
    0 24px 60px rgba(0, 0, 0, 0.55),
    0 4px 12px rgba(0, 0, 0, 0.35);
}

/* ── WHAT A MENU'S TEXT HAS TO BE ONCE THE MENU IS GLASS ──────────────────
   The type in these lists was set for an OPAQUE panel: 12.5px at --ink-2 for
   the name, 11.5px at --ink-3 for the line under it, 10px mono at --ink-3 for
   the group header. Those tiers were measured against a solid fill, and they
   passed against a solid fill.

   Glass took the fill away. The background under each row is now whatever the
   page happens to be showing through it, so the contrast a tier was chosen for
   is no longer the contrast it delivers, and it varies row to row. Small type
   is what fails first: the model list read as grey-on-grey, the group headers
   ("resolution", "How long") all but disappeared, and the only row anyone
   could actually read was the selected one — because that one alone was --ink.

   So the answer is not a nudge in size. It is that on glass THE NAME OF THE
   THING YOU ARE CHOOSING IS FULL-STRENGTH INK, always, not just when it is
   already chosen; the sentence under it drops exactly one tier and no further;
   and the group header stops being a 10px mono whisper. Everything a row says
   about itself is secondary to what the row IS.

   Same specificity trick as the material rule: (1,0,2) beats the studios'
   (1,0,1), so no !important and their own colours are still theirs. */
body #pop button, body #tl-qpop button, body #im-flyout button,
body #profile-menu button, body #tiermenu button, body #flyout button,
body #settings button, body #assets button, body #ctx button,
body .pop button, body .popover button, body .menu button {
  font-size: 14px;
  color: var(--ink);
}
body #pop .meta, body #pop .mrow .meta, body #pop .msub,
body .pop .meta, body .pop .mrow .meta, body .pop .msub,
body .popover .meta, body .menu .meta {
  font-size: 12.5px;
  line-height: 1.4;
  color: var(--ink-2);
}
body #pop .mrow .mprice, body .pop .mrow .mprice,
body .popover .mprice, body .menu .mprice {
  font-size: 12.5px;
  color: var(--ink-2);
}
body #pop h6, body #tl-qpop h6, body #im-flyout h6,
body #profile-menu h6, body #tiermenu h6, body #flyout h6,
body #settings h6, body #assets h6, body #ctx h6,
body .pop h6, body .popover h6, body .menu h6 {
  font-size: 11.5px;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--ink-2);
  padding-top: 10px;
}

/* ── THE BAR ACROSS THE TOP ───────────────────────────────────────────────
   It was pitch #000 under a comment calling it "the app's edge" — darker than
   everything so it reads as an edge, and a hard top for the dot field. That
   reasoning was right for a flat app and is wrong for this one: in the
   reference the chrome is the FIRST thing made of glass, and a black bar over
   a glass app looks like a lid someone left on.

   Tinted rather than clear, and only lightly blurred: the field behind it is
   the animated dot canvas, and a heavy blur here is the exact case that
   measured 181ms a frame. 14px over a mostly-black field is cheap and still
   lets the sea show as movement under the chrome, which is what the hard top
   was preventing. */
/* ── THE BAR: BLACK GROUND, ONE SHEET OF GLASS ACROSS THE WHOLE OF IT ─────
   Edge to edge, because a bar is a bar — the inset version read as a floating
   pill parked in a black gutter, which is a widget, not chrome.

   WHAT MAKES THE REFERENCE LOOK LIKE GLASS AND MINE LOOK LIKE A FILM. On a
   plain ground with nothing behind it, Apple's capsules still read as solid
   glass, and it is not the blur doing it — it is three things the flat version
   had none of:

   1. THE RIM IS A SPECULAR, NOT A BORDER. Near-white, hairline, and it
      TRAVELS: brightest along the top where the light is, almost gone down the
      sides, and returning along the bottom as bounce off the surface. A single
      even edge at 30% reads as a stroke someone drew. Two edges at very
      different strengths read as a solid object catching light.
   2. THE BODY IS A LENS, NOT A TINT. Nearly clear in the middle with the sheen
      hugging the top few pixels, so what shows through is brightened rather
      than veiled. brightness() in the backdrop stack is what does that — it
      lifts whatever is behind instead of laying more white over it.
   3. IT CASTS. A shadow under the bottom edge is most of what says the sheet
      is lying ON the black rather than being a lighter part of it.

   The ground keeps a little transparency on purpose. Black at 100% leaves the
   glass with literally nothing to refract, which is how this got flat twice
   already — the dot ocean runs the full viewport underneath, and letting a
   tenth of it through gives the blur something to smear into soft light.
   Still reads black; just not dead. */
body .sidebar { background: transparent; }
body .sidebar::before,
body .sidebar::after {
  content: "";
  /* ── BOUND TO THE BAR, NOT TO THE VIEWPORT ────────────────────────────────
     These were `fixed; top: 0; height: var(--navh)`, which pins the glass to
     the top of the WINDOW while the nav it belongs to is `sticky` in the flow.
     Two different coordinate systems for one object: anything that moves the
     bar without moving the viewport — an overscroll, a fullscreen change, the
     moment before sticky engages — slides the text off its own glass and
     leaves a black band where the bar used to be. The sheet and the thing
     standing on it have to be the same object.

     `absolute; inset: 0` makes them the bar's own surface. The containing
     block for an absolutely positioned child of a scroll container is its
     PADDING BOX, which spans the whole scrollable width — so at narrow widths,
     where the bar scrolls sideways, the glass is as wide as the content and
     travels with it instead of sliding out from under the right-hand end.
     .sidebar is already `position: sticky`, so it establishes the containing
     block without another declaration. --navh is no longer load-bearing here;
     the height is simply the bar's height, which is what it always meant. */
  position: absolute;
  inset: 0;
  pointer-events: none;
}
/* THE GROUND — THE RAIL'S TINT, FOR THE RAIL'S REASON.
   This was rgba(0,0,0,.55): pure black, which is precisely the mistake the
   rail rule below spent a paragraph on. Black over a near-black field cannot
   do anything but darken it, so the bar read as a hole cut across the top
   rather than a surface laid over it — and against the chrome, where there is
   actually something moving underneath to occlude, it was worse than over the
   dots. Same lifted grey as the studio rails, same alpha: it composites ABOVE
   the page instead of below it, which is what makes glass look laid on. */
body .sidebar::before {
  z-index: -2;
  background: rgba(16, 16, 17, 0.62);
}
/* THE SHEET */
body .sidebar::after {
  z-index: -1;
  background:
    /* THE HOT SPOT. Real glass is lit from somewhere; an even film is lit from
       nowhere, and that is most of why a flat bar reads as a painted strip. A
       wide, very soft highlight off to the left gives the sheet a direction to
       be lit from, and the eye reads the falloff across the width as curvature
       even on something perfectly flat. */
    radial-gradient(160% 320% at 22% -60%,
      rgba(255, 255, 255, 0.13), rgba(255, 255, 255, 0) 58%),
    linear-gradient(180deg,
      rgba(255, 255, 255, 0.15) 0px,
      rgba(255, 255, 255, 0.06) 4px,
      rgba(255, 255, 255, 0.018) 42%,
      rgba(255, 255, 255, 0.02) 72%,
      rgba(255, 255, 255, 0.06) calc(100% - 3px),
      rgba(255, 255, 255, 0.10) 100%),
    rgba(255, 255, 255, 0.028);
  /* THE RAIL'S RECIPE, EXACTLY. This carried brightness(1.22) and the rail
     does not, which is the whole reason the bar read lighter and washed
     beside it — same tint, different lift. Matched now. */
  -webkit-backdrop-filter: blur(30px) saturate(124%);
  backdrop-filter: blur(30px) saturate(124%);
  /* NO WHITE EDGE. The specular rim and the edge-lens glow are what a capsule
     wants and what a full-width bar does not: on a shape you can see all of,
     a bright edge reads as light catching a form, but stretched flat across
     1440px with no corners it is just a white line ruled under the nav, and
     it drew the eye to the join instead of to anything on the bar.

     The sheet still reads as a sheet — the hot spot gives it a direction, the
     body is lighter than the ground, and it separates DOWNWARD instead: a
     dark hairline and a cast shadow, which is the same statement made in
     shadow rather than in highlight. */
  box-shadow:
    0 1px 0 rgba(0, 0, 0, 0.9),
    0 10px 26px rgba(0, 0, 0, 0.55);
}
/* ── THE RAIL IS CHROME, SO IT SHARES THE BAR'S GROUND ────────────────────
   The four studio rails were --veil (#141416), the token for cards and panels
   — lighter than the ground they sit on, so the left column read as a tall
   card standing in the page rather than as the app's edge. The bar across the
   top is black; the rail down the left is the same piece of furniture turned
   ninety degrees, and it should be the same colour.

   Darker than the ground rather than lighter, and a whisper of transparency
   for the same reason the bar keeps some: the dot ocean runs underneath and a
   flat fill kills it. Specificity (0,2,1) beats the studios' own (0,2,0). */
body .sidebar.fg-mode #fg-sidepanel,
body .sidebar.rx-mode #rx-sidepanel {
  /* THE TINT'S COLOUR IS THE WHOLE ARGUMENT, NOT ITS ALPHA. Two attempts got
     this wrong the same way: 0.72 black, then 0.52 black. Both were genuinely
     translucent — and both looked like a wall, because black over a near-black
     field cannot do anything but darken it. Measured: the ocean behind the
     rail is identical to the page beside it (avg 7.6, 13.4% of pixels lit),
     and 0.52 black took that to 4 while the page next to it stayed 8. Half as
     bright as its neighbour is not glass, it is a hole, however much light is
     technically passing through.

     The menus read as glass because their tint is a LIFTED grey — rgba(20,22,
     26,.62) composites to about 16 over the same field, above the page rather
     than below it, which is what makes a surface look like something laid on
     top. Same alpha here, tint one notch darker: this is chrome and they are
     panels floating over content, so it should sit below them and still above
     the page. Lands near 12 on flat water and 35 through a lit crest, so the
     dots travel under it instead of dying in it. */
  background: rgba(16, 16, 17, 0.62);
  -webkit-backdrop-filter: blur(30px) saturate(124%);
  backdrop-filter: blur(30px) saturate(124%);
  box-shadow: inset -1px 0 0 rgba(255, 255, 255, 0.07);
}

/* The account cluster was its own opaque #000 block riding on the bar — a
   black rectangle punched through the sheet. It gives up its fill and lets the
   glass carry it. */
body .sidebar-foot { background: transparent; }

/* ── ONE MATERIAL, EVERY STUDIO'S OWN CONTROL CLASSES ─────────────────────
   Each studio declares its own .btn / .chip / .pill in its own <style> block,
   and those blocks come AFTER this file, so a bare `.chip {}` here would lose
   on order. `body .chip` is specificity (0,1,1) against their (0,1,0), which
   wins wherever it is written — no !important needed, and their own colours
   are still theirs to set.

   THE TWO THINGS THE PER-FILE PASS COULD NOT GIVE THEM: a translucent base and
   the blur. Measured on the composer's chips before this rule: background
   rgb(28,28,32), backdrop-filter none — an opaque dark fill with a bright edge
   drawn on it, which is a button wearing a rim, not glass. The material only
   arrives when there is something to see THROUGH.

   .tab is deliberately absent. Nav tabs carry no fill at rest on purpose and a
   film would turn every one into a permanently visible chip — the same
   reasoning that kept them out of the first pass. */
body .btn,
body .chip,
body .pill,
body .step {
  background:
    var(--glass-glow),
    linear-gradient(180deg, var(--glass-film-top), var(--glass-film-bot)),
    rgba(255, 255, 255, 0.07);
  -webkit-backdrop-filter: var(--glass-blur);
  backdrop-filter: var(--glass-blur);
  border-radius: var(--radius-pill);
  box-shadow:
    inset 0 1px 0 var(--glass-rim-top),
    inset 0 -1px 0 var(--glass-rim-bottom),
    var(--glass-depth),
    var(--glass-lift);
}
/* A control that sets its own colour keeps it — the film and the blur ride on
   top. This is the escape hatch for primaries, and it is why the rule above
   states a base rather than `transparent`: without one, an unstyled control
   would have nothing for the blur to tint. */
/* BACKGROUND-IMAGE, NOT BACKGROUND. The shorthand version of this rule set a
   colour as well, and the only colour available to it was `currentColor` —
   which on a chip is the TEXT colour. So every .chip.on, whose text is --ink,
   got a near-white fill with near-white text on it: a studio's Model chip turned
   into a white pill with the word "Model" left legible only because its label
   span sets its own grey. Naming only background-image leaves background-color
   untouched, so the state colour each studio chose for itself survives and the
   film rides on top of it, which is what the comment always claimed. */
body .btn[class*="primary"],
body .btn[class*="signal"],
body .chip.on,
body .chip.chipsel {
  background-image:
    var(--glass-glow),
    linear-gradient(180deg, var(--glass-film-top), var(--glass-film-bot));
}

/* ── HOVER HAS TO GO UP, AND IT WAS GOING DOWN ────────────────────────────
   The material above gives a control at rest a bright film — glow at 0.16 over
   a 0.07 gradient — so the TOP of a chip composites near rgb(70) on a dark
   board. Studios that state their own hover as an opaque fill are darker than
   that: the studio's own is --veil-3, rgb(42). Their rule is (0,2,0) and wins the
   colour, so hovering made the top of the pill DARKEN and the bottom lighten —
   feedback that inverts along its own height. An earlier studio page named
   this exact failure: "hovering would read as the glass going matte and
   slightly darker. Backwards feedback is worse than none."

   background-image only, again, so whatever colour a studio chose for its
   hover state is still the colour — this just guarantees the film on top is
   brighter than the film at rest, which is the only thing that makes the step
   positive everywhere regardless of what is underneath. */
body .btn:hover,
body .chip:hover,
body .pill:hover,
body .step:hover {
  background-image:
    var(--glass-glow),
    linear-gradient(180deg, rgba(255, 255, 255, 0.20), rgba(255, 255, 255, 0.10));
}

/* ── THE BEVEL ────────────────────────────────────────────────────────────
   A ring one pixel wide whose brightness travels around the shape: strongest
   at the top-left where the light is, gone by the middle, returning faintly at
   the bottom-right as bounce off whatever the control is lying on. That
   travel is what a 1px inset shadow cannot do and what makes an edge read as
   a bevel rather than as a border.

   The mask trick is the standard one: paint the gradient over the whole box,
   then subtract the content box so only the padding ring survives. */
.tl-btn::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  padding: 1px;
  background: linear-gradient(150deg,
    var(--glass-rim-top) 0%,
    rgba(255, 255, 255, 0.18) 28%,
    rgba(255, 255, 255, 0.02) 52%,
    var(--glass-rim-bottom) 78%,
    rgba(255, 255, 255, 0.28) 100%);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  mask-composite: exclude;
  pointer-events: none;
}

/* The hover shorthand replaces the WHOLE background, shine layer included, so
   the stack is restated here or the sweep would have nothing to travel across
   at exactly the moment it is meant to run. */
.tl-btn:hover {
  --shine: 145%;
  background:
    var(--glass-glow),
    /* THE SHINE. A band of light crossing the face on hover, parked off the
       left edge the rest of the time. It is a background LAYER rather than a
       pseudo-element because both pseudos are spoken for — the glass bevel on
       ::before, the chrome rim on ::after for the blue ones. Driven by a
       REGISTERED percentage: an unregistered custom property interpolates as
       a string and would jump instead of sweeping. */
    linear-gradient(115deg,
      transparent calc(var(--shine) - 24%),
      rgba(255,255,255,.42) var(--shine),
      transparent calc(var(--shine) + 24%)),
    linear-gradient(180deg, var(--glass-film-top), var(--glass-film-bot)),
    var(--btn-hover-bg);
  border-color: var(--btn-hover-border);
}

.tl-btn:active {
  background: var(--btn-active-bg);
  transform: translateY(1px);
}

.tl-btn:disabled,
.tl-btn[aria-disabled="true"] {
  opacity: 0.45;
  cursor: not-allowed;
  pointer-events: none;
}

/* Primary: white surface, ground-coloured type — resting. Lime only when
   .is-live, which login.html toggles from JS. */
/* The hover step goes DOWN, not up. --ink is #FBFBFB, so the old hover value of
   #FFFFFF was a 4/255 change — 1.6% lightness, i.e. no hover feedback at all on
   the app's 37 primary buttons, and hover is the one state here with no
   transform to fall back on. Rest 251 → hover 232 → active 216 is one even
   ladder in the same direction, which is also how every other button reads:
   pressing a surface makes it darker. */
.tl-btn--primary {
  --btn-bg: var(--ink);
  --btn-fg: var(--on-signal);
  --btn-border: transparent;
  --btn-hover-bg: #E8E8E8;
  --btn-hover-border: transparent;
  --btn-active-bg: #D8D8D8;
}

/* Live / running primary — the one place lime is a button fill. */
/* ── THE BLUE BUTTONS WEAR THE CHROME ─────────────────────────────────────
   Same material as the rail wells, adapted to a pill.

   TWO things had to change for a rectangle. The rim uses --iris-arcs-open,
   whose gaps are TRANSPARENT rather than near-black: on a circle the dark
   stops read as unlit metal, but on a pill they land on the flat sides and
   punch four holes in the edge, and the glass bevel underneath shows through
   the gaps instead. And the light cannot ride the rim the way it does on a
   circle, because a highlight tracking a rounded rectangle is unmistakably
   going AROUND something.

   So the light goes BEHIND THE FACE. Two soft masses drift across the button
   under the label, on periods that do not divide each other, so the bright
   part wanders and folds rather than wiping past. They are background layers,
   not elements — ::before is the glass bevel and ::after is the rim, and this
   needs no third pseudo and no markup change to twenty-two buttons. */
.tl-btn--primary.is-live,
.tl-btn--signal {
  /* SEE-THROUGH, NOT FILLED. This used to end in `var(--signal)` — a solid
     fill, and the reason every primary button read as a slab. The fill is
     gone: the chrome background runs under the control and the RIM says this
     is the important one.

     The two drifting masses stay, fainter, because a completely empty pill
     gives the eye nothing to catch — but they are light under glass now
     rather than a wash over a colour. */
  --btn-bg:
    radial-gradient(58% 175% at var(--lq1) 42%,
      rgba(255,255,255,.16), rgba(226,232,240,.06) 55%, transparent 76%),
    radial-gradient(52% 165% at var(--lq2) 58%,
      rgba(232,238,246,.12), rgba(255,250,242,.05) 58%, transparent 78%),
    rgba(255,255,255,.045);
  animation: liquidDrift 17s ease-in-out infinite;
  /* White, because the button is see-through now: --on-signal is near-black
     ink for a bright slab and vanished over a dark moving ground. */
  --btn-fg: #f4f6fa;
  --btn-border: transparent;
  --btn-hover-bg: rgba(255,255,255,.085);
  --btn-hover-border: transparent;
  --btn-active-bg: rgba(255,255,255,.12);
}

/* NO RIM ON THE BUTTONS EITHER.

   There was a prismatic ring here, and rings on the rail tiles, and a chrome
   field behind all of it — the same material said three times. Every one of
   them was drawing the eye, and none of them was the subject.

   The rule now is simple: chrome is the BACKGROUND, and nothing else is
   chrome. Controls are glass over it. What makes a button read is its edge
   and its lift, and the field moving underneath does the rest — which is
   more like real glass anyway, where the colour you see is the room behind,
   not something the glass is doing.

   The tokens stay: --iris-arcs-open and the flow keyframes are still used by
   .iris, and by anything that later wants a rim on purpose. */

/* Uneven, and the two never cross at the same place twice. */
@keyframes liquidDrift {
  0%   { --lq1: 12%; --lq2: 78% }
  27%  { --lq1: 62%; --lq2: 41% }
  48%  { --lq1: 38%; --lq2: 88% }
  71%  { --lq1: 84%; --lq2: 26% }
  100% { --lq1: 12%; --lq2: 78% }
}

.tl-btn--ghost {
  --btn-bg: transparent;
  --btn-fg: var(--ink-2);
  --btn-border: transparent;
  --btn-hover-bg: var(--veil-2);
  --btn-hover-border: transparent;
  --btn-active-bg: var(--veil);
}

/* Set the slot, not `color`. A bare `color` here is (0,2,0) and loses to the
   `.tl-page a.tl-btn { color: var(--btn-fg) }` specificity patch at the top of
   the file (0,2,1), so the three <a class="tl-btn tl-btn--ghost"> in landing,
   canva and the other pages would never have brightened. Re-pointing --btn-fg is read by
   both that rule and .tl-btn's own `color`, so link and button behave alike. */
.tl-btn--ghost:hover {
  --btn-fg: var(--ink);
}

/* Outline used to be the border-only button, which no longer exists. It keeps
   its place in the ladder as the quietest button that still has a surface:
   ghost = nothing, outline = --veil, default = --veil-2. */
.tl-btn--outline {
  --btn-bg: var(--veil);
  --btn-fg: var(--ink);
  --btn-border: transparent;
  --btn-hover-bg: var(--veil-2);
  --btn-hover-border: transparent;
  --btn-active-bg: var(--veil);
}

.tl-btn--danger {
  --btn-bg: rgba(240,68,90, 0.12);
  --btn-fg: var(--ember);
  --btn-border: transparent;
  --btn-hover-bg: rgba(240,68,90, 0.2);
  --btn-hover-border: transparent;
  --btn-active-bg: rgba(240,68,90, 0.28);
}

/* min-height on all three sizes is the hit target — the pill changes the shape,
   never the height, and --icon is square only because width equals min-height. */
.tl-btn--sm {
  min-height: 32px;
  padding: 0.35rem 0.75rem;
  font-size: var(--text-xs);
  border-radius: var(--radius-pill);
}

.tl-btn--lg {
  min-height: 48px;
  padding: 0.75rem 1.35rem;
  font-size: var(--text-body);
  border-radius: var(--radius-pill);
}

.tl-btn--icon {
  width: 40px;
  padding: 0;
}

.tl-btn--icon.tl-btn--sm {
  width: 32px;
}

/* ── Cards & panels ──────────────────────────────────────────────────────── */

/* One veil per nesting level. A card is --veil; a control inside it is --veil-2;
   a content group inside it gets no fill at all and separates on spacing. Two
   veils stacked composite to two almost identical greys and read as mush. */
.tl-card {
  position: relative;
  background: var(--veil);
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
  padding: var(--space-5);
  transition: background var(--dur) var(--ease-out);
}

.tl-card:hover {
  background: var(--veil-2);
}

.tl-card--interactive {
  cursor: pointer;
}

.tl-card--interactive:hover {
  background: var(--veil-3);
}

.tl-card--interactive:active {
  transform: translateY(1px);
}

.tl-card__title {
  font-family: var(--font-display);
  font-size: var(--text-h3);
  font-weight: 500;
  letter-spacing: -0.02em;
  color: var(--ink);
  margin: 0 0 var(--space-2);
}

.tl-card__meta {
  font-family: var(--font-body);
  font-size: var(--text-tele);
  color: var(--ink-3);
  margin: 0 0 var(--space-3);
}

.tl-card__body {
  font-size: var(--text-sm);
  color: var(--ink-2);
  line-height: 1.5;
  margin: 0;
}

.tl-panel {
  background: var(--veil);
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
  overflow: hidden;
}

/* Head and foot are chrome, so they take the control tone. The 1px rules stay
   declared and transparent: the separation is the tonal step, not a line. */
.tl-panel__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  padding: var(--space-4) var(--space-5);
  border-bottom: 1px solid var(--line);
  background: var(--veil-2);
}

.tl-panel__title {
  font-family: var(--font-display);
  font-size: var(--text-sm);
  font-weight: var(--w-title);
  letter-spacing: -0.01em;
  color: var(--ink);
  margin: 0;
}

.tl-panel__body {
  padding: var(--space-5);
}

.tl-panel__foot {
  padding: var(--space-3) var(--space-5);
  border-top: 1px solid var(--line);
  background: var(--veil-2);
}

/* ── Form controls ───────────────────────────────────────────────────────── */

.tl-label {
  display: block;
  font-size: var(--text-xs);
  font-weight: 500;
  color: var(--ink-2);
  margin-bottom: var(--space-2);
}

/* Inputs are a control tone on the ground, not a hole cut into it. min-height
   stays 40px — it is the hit target, and only the shape becomes a pill. */
.tl-input,
.tl-select,
.tl-textarea {
  display: block;
  width: 100%;
  min-height: 40px;
  padding: 0.55rem 0.85rem;
  font-family: var(--font-body);
  font-size: var(--text-sm);
  font-weight: var(--w-body);
  line-height: 1.4;
  color: var(--ink);
  background: var(--veil-2);
  border: 1px solid var(--line);
  border-radius: var(--radius-pill);
  transition:
    background var(--dur-fast) var(--ease-out),
    box-shadow var(--dur-fast) var(--ease-out);
  appearance: none;
  -webkit-appearance: none;
}

.tl-input::placeholder,
.tl-textarea::placeholder {
  color: var(--ink-3);
}

/* Hover and focus used to speak only through border-color, which is now
   transparent. Both are carried on the surface tone instead; :focus-visible
   also keeps the outline and --focus-ring set in the focus block above. */
.tl-input:hover,
.tl-select:hover,
.tl-textarea:hover {
  background: var(--veil-3);
}

.tl-input:focus-visible,
.tl-select:focus-visible,
.tl-textarea:focus-visible {
  background: var(--veil-3);
}

.tl-input:disabled,
.tl-select:disabled,
.tl-textarea:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}
/* ══ THE MOVING GROUND ═════════════════════════════════════════════════════
   AN OCEAN OF DOTS WITH WAVES GOING OVER IT, in black and grey.

   The first attempt at this was drifting radial blobs — a fog, not a surface.
   A field of dots reads as a plane you are looking across, and a travelling
   wave over that plane reads as motion THROUGH it rather than a picture being
   slid about. The dots are the sea; the wave is the weather.

   It is drawn on a canvas (see tlOcean in tl.js) because a grid of ~4,000
   points each with its own brightness and offset is one draw call there and
   4,000 animated DOM nodes anywhere else.

   The element below is the canvas's stage. Everything about how it moves is in
   the script; everything about where it sits is here. */
#tl-ocean {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  display: block;
}
/* The ground has to be see-through for any of it to show. Panels and cards
   stay opaque — see the veil ladder — so the sea is only ever visible in the
   gaps between things, which is the whole point of it. */
body { background: transparent; }
/* The colour of the ground lives here, under the canvas. */
/* A FLOOR UNDER THE FIELD — A BASE, NOT SPOTS.
   The first attempt at this put two soft lifts at 18% 8% and 88% 96%, which
   fixed the two corners it touched and left everything between them on the
   bare #0A0A0B. The middle-left went on reading as a hole, which is exactly
   where it kept being reported. A floor that only covers part of the room is
   not a floor.

   So the base is a gradient in its own right and there is nowhere it does not
   reach: a vertical lift under everything, with two broader pools over it for
   direction. Composited under the field at .62 the darkest result is about
   #101014 — a deep grey you can tell from black, which is the whole point. */
html {
  background:
    radial-gradient(150% 115% at 20% 6%,  #1e1f27 0%, rgba(30,31,39,0) 68%),
    radial-gradient(130% 105% at 86% 94%, #191a22 0%, rgba(25,26,34,0) 64%),
    linear-gradient(180deg, #16171d 0%, #111116 55%, #141419 100%);
}
/* NO RUBBER-BANDING. macOS lets you drag a page past its bounds even when
   there is nothing there — the Edit view could be pushed right and up into
   empty space, which reads as broken layout rather than as a bounce. This is
   also what stops a scroll inside a studio from chaining out to the shell. */
html, body { overscroll-behavior: none; }

/* THE SCROLLBAR IS NOT PART OF THE DESIGN.
   A white overlay bar appears down the right of any studio that scrolls, on
   top of the glass and the field, and it is the one bright vertical line on
   an otherwise dark page. The content still scrolls by wheel, trackpad, keys
   and touch — only the painted bar goes. Firefox gets scrollbar-width; the
   rest get the pseudo-element, and both are needed because neither covers
   the other's engine. */
* { scrollbar-width: none; }
*::-webkit-scrollbar { width: 0; height: 0; }

/* Buttons do not inherit font-family from the UA stylesheet — they get Arial
   13.33px unless something says otherwise. Home is built ENTIRELY from
   <button> (.hf-tile, .hf-card, .hf-open-card), so every tile title, card
   caption and description on that screen was rendering in Arial while the rest
   of the app was in Inter. It is the largest single visual difference on the
   page and it survived a full palette pass, because colour tokens say nothing
   about type.

   font-family, NOT the `font` shorthand: the shorthand also resets font-size
   to 16px, which would resize every unstyled button in the app. And NOT merged
   into the control base coat below — that block paints a background and a
   radius, which would repaint every bare button there is. */
button { font-family: inherit; }

/* BASE COAT for native controls. .tl-select / .tl-textarea are opt-in classes,
   so any select or input that never got one fell through to the browser's own
   dark-mode default — rgb(59,59,59), a warm grey that belongs to no palette we
   chose. The Products and Sales panels were full of them. These are bare
   element selectors (specificity 0,0,1), so every existing class rule still
   wins; this only catches what nothing else styles. */
select,
input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="color"]),
textarea {
  background: var(--veil-2);
  color: var(--ink);
  border: 1px solid transparent;
  border-radius: var(--radius-sm, 8px);
  font: inherit;
}
select:hover,
input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="color"]):hover,
textarea:hover { background: var(--veil-3); }

select::placeholder, input::placeholder, textarea::placeholder { color: var(--ink-3); }

/* Any select that stays native (data-native, or a page that never calls
   TL.enhanceSelects) still opens the browser's own menu. :root already says
   dark and the property inherits, but a page-local color-scheme on a panel
   would take that back — so the control asks for itself. */
select { color-scheme: dark; }


/* The caret is a data-URI, so no token reaches it — the stroke is hand-set to
   the neutral grey the new ink scale resolves to. */
.tl-select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8' fill='none'%3E%3Cpath d='M1 1.5L6 6.5L11 1.5' stroke='%239A9A9A' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.85rem center;
  padding-right: 2.25rem;
  cursor: pointer;
}

/* Multi-line, so it takes the box radius rather than the control pill. */
.tl-textarea {
  min-height: 96px;
  resize: vertical;
  padding-top: 0.7rem;
  padding-bottom: 0.7rem;
  border-radius: var(--radius);
}

.tl-input--mono,
.tl-select--mono {
  font-family: var(--font-body);
  font-size: var(--text-tele);
  font-variant-numeric: tabular-nums;
}

/* ── THE DROPDOWN ────────────────────────────────────────────────────────────
   TL.enhanceSelects (tl.js) hides a <select> and stands a button beside it
   that opens a listbox of our own. The native menu is the one surface in the
   app the sheet cannot paint — the OS draws it, white — and this is the
   replacement. The menu is the #ask dialog's surface: --solid, --lift, and the
   same inset hairline, so a list opening over a dark panel belongs to it.

   Sizing follows the pages' own select rules (40px hit target, 15px text,
   full width of the row) so a form does not move when the button takes the
   select's place. */

/* Hidden, not display:none: the select keeps its layout slot, stays in the
   form, and keeps taking .value and 'change' from page code. Clipped to a
   pixel rather than opacity alone, so nothing can be clicked through to it. */
.tl-dd-native {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  min-height: 0 !important;
  margin: -1px !important;
  padding: 0 !important;
  border: 0 !important;
  overflow: hidden !important;
  clip: rect(0 0 0 0) !important;
  clip-path: inset(50%) !important;
  white-space: nowrap !important;
  pointer-events: none !important;
  opacity: 0 !important;
}

.tl-dd {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem;
  width: 100%;
  min-height: 40px;
  padding: 9px 14px;
  font: inherit;
  font-size: 15px;
  line-height: 1.4;
  text-align: left;
  color: var(--ink);
  background: var(--veil-2);
  border: 1px solid transparent;
  border-radius: var(--radius-pill);
  cursor: pointer;
  transition: background var(--dur-fast) var(--ease-out);
}
.tl-dd:hover,
.tl-dd.is-open { background: var(--veil-3); }
.tl-dd:disabled { opacity: 0.5; cursor: not-allowed; }
.tl-dd-label {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
/* A stroked chevron in currentColor, so it takes the token instead of the
   hand-set grey the data-URI caret carries. Rotates open. */
.tl-dd-chev {
  flex: none;
  width: 12px;
  height: 8px;
  color: var(--ink-2);
  background: currentColor;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8' fill='none'%3E%3Cpath d='M1 1.5L6 6.5L11 1.5' stroke='%23000' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8' fill='none'%3E%3Cpath d='M1 1.5L6 6.5L11 1.5' stroke='%23000' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / contain no-repeat;
  transition: transform var(--dur-fast) var(--ease-out);
}
.tl-dd.is-open .tl-dd-chev { transform: rotate(180deg); }

/* Fixed and on <body>, above the drawers (z 3) and the #ask scrim (z 90),
   under the walkthrough (z 9000) — a tour that points at a select should
   still be able to cover its menu. */
.tl-dd-menu {
  position: fixed;
  z-index: 200;
  box-sizing: border-box;
  max-width: min(420px, calc(100vw - 16px));
  padding: 6px;
  overflow-y: auto;
  overscroll-behavior: contain;
  background: var(--solid);
  color: var(--ink);
  border-radius: var(--radius);
  box-shadow: var(--lift), 0 0 0 1px rgba(255, 255, 255, 0.07) inset;
  font-size: 15px;
  line-height: 1.4;
  animation: tl-dd-in var(--dur-fast) var(--ease-out);
}
@keyframes tl-dd-in { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }
.tl-dd-menu.is-above { animation-name: tl-dd-in-up; }
@keyframes tl-dd-in-up { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) {
  .tl-dd-menu, .tl-dd-chev { animation: none; transition: none; }
}

.tl-dd-opt {
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
/* Highlight is the keyboard's cursor and the pointer's hover — one tone for
   both, so the mouse and the arrows never disagree about where you are. The
   current value is marked by weight, not by a second colour. */
.tl-dd-opt.is-hl { background: var(--veil-3); }
.tl-dd-opt.is-sel { font-weight: 500; }
.tl-dd-opt[aria-disabled="true"] { color: var(--ink-3); cursor: not-allowed; }

.tl-dd-group + .tl-dd-group,
.tl-dd-opt + .tl-dd-group { margin-top: 4px; }
.tl-dd-group-label {
  padding: 8px 12px 4px;
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--ink-3);
  cursor: default;
}

.tl-field {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

/* `display: flex` above is (0,1,0) and beat the `hidden` attribute's UA rule,
   so a [hidden] .tl-field stayed on screen — login.html's "Your name" field was
   visible on the sign-in door. setMode() drives that attribute, so the fix
   belongs to the component, not to the page. */
.tl-field[hidden] {
  display: none !important;
}

.tl-field__hint {
  font-size: var(--text-xs);
  color: var(--ink-3);
}

.tl-field__error {
  font-size: var(--text-xs);
  color: var(--ember);
}

/* ── Badge & chip ────────────────────────────────────────────────────────── */

/* Every variant is a tint plus its own ink. The border-color slots that used to
   ring each badge are transparent now; the 1px stays declared for the box. */
.tl-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  min-height: 22px;
  padding: 0.15rem 0.5rem;
  font-family: var(--font-body);
  font-size: 0.6875rem;
  font-weight: var(--w-title);
  line-height: 1;
  color: var(--ink-2);
  background: var(--veil-2);
  border: 1px solid var(--line);
  border-radius: var(--radius-pill);
  white-space: nowrap;
}

.tl-badge--signal {
  color: var(--on-signal);
  background: var(--signal);
  border-color: transparent;
}

.tl-badge--live {
  color: var(--signal);
  background: rgba(200, 255, 0, 0.1);
  border-color: transparent;
}

/* A solid lime disc — the sanctioned live signal. It pulses on opacity now;
   the old three-frame spread ring was a coloured glow. */
.tl-badge--live::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--signal);
  animation: tl-pulse-dot 1.8s var(--ease-in-out) infinite;
}

.tl-badge--ember {
  color: var(--ember);
  background: rgba(240,68,90, 0.12);
  border-color: transparent;
}

.tl-badge--ok {
  color: var(--ok);
  background: rgba(46, 213, 115, 0.1);
  border-color: transparent;
}

.tl-badge--warn {
  color: var(--warn);
  background: rgba(255, 176, 32, 0.1);
  border-color: transparent;
}

.tl-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  min-height: 30px;
  padding: 0.3rem 0.7rem;
  font-family: var(--font-body);
  font-size: var(--text-xs);
  font-weight: var(--w-title);
  color: var(--ink-2);
  background: var(--veil-2);
  border: 1px solid var(--line);
  border-radius: var(--radius-pill);
  cursor: pointer;
  transition:
    background var(--dur-fast) var(--ease-out),
    color var(--dur-fast) var(--ease-out);
}

.tl-chip:hover {
  color: var(--ink);
  background: var(--veil-3);
}

/* index.html toggles .is-on / aria-pressed on the explorer filters. The lime
   ring used to be the whole signal; the pair that carries it now is the veil
   step plus full-strength ink against every other chip's --ink-2, with the
   solid dot below telling "on" apart from "hovered". */
.tl-chip.is-on,
.tl-chip[aria-pressed="true"] {
  color: var(--ink);
  border-color: transparent;
  background: var(--veil-3);
}

.tl-chip.is-on::before,
.tl-chip[aria-pressed="true"]::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--signal);
  flex-shrink: 0;
}

/* ── Table ───────────────────────────────────────────────────────────────── */

.tl-table-wrap {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
  background: var(--veil);
}

.tl-table {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--text-sm);
  color: var(--ink-2);
}

/* No ruled rows. The header is set apart by ink weight and the row rhythm, the
   rows by the hover tone — the 1px rules stay declared and transparent so the
   cell padding boxes keep the sizes every column width was measured against. */
.tl-table th {
  font-family: var(--font-body);
  font-size: var(--text-tele);
  font-weight: var(--w-title);
  text-align: left;
  color: var(--ink-3);
  background: transparent;
  border-bottom: 1px solid var(--line);
  padding: 0.75rem 1rem;
  white-space: nowrap;
}

.tl-table td {
  padding: 0.85rem 1rem;
  border-bottom: 1px solid var(--line-soft);
  vertical-align: middle;
}

.tl-table tbody tr:last-child td {
  border-bottom: none;
}

.tl-table tbody tr {
  transition: background var(--dur-fast) var(--ease-out);
}

.tl-table tbody tr:hover {
  background: var(--veil-2);
}

.tl-table .tl-num,
.tl-table .is-tele {
  font-family: var(--font-body);
  font-variant-numeric: tabular-nums;
  color: var(--ink);
}

.tl-table .is-primary {
  color: var(--ink);
  font-weight: var(--w-title);
}

/* ── Empty state ─────────────────────────────────────────────────────────── */

/* The dash is gone: an empty region reads as a held-open veil, not as a cut-out
   ticket edge. `solid` rather than deleted keeps the 1px in the padding box so
   the region does not grow by 2px in whatever grid it sits in. */
.tl-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: var(--space-3);
  padding: var(--space-12) var(--space-6);
  min-height: 200px;
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
  background: var(--veil);
}

.tl-empty__icon {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  border-radius: var(--radius-pill);
  background: var(--veil-2);
  border: 1px solid var(--line);
  color: var(--ink-3);
  font-size: 1.25rem;
  margin-bottom: var(--space-1);
}

.tl-empty__title {
  font-family: var(--font-display);
  font-size: var(--text-h3);
  font-weight: var(--w-title);
  letter-spacing: -0.02em;
  color: var(--ink);
  margin: 0;
}

.tl-empty__body {
  max-width: 28rem;
  font-size: var(--text-sm);
  line-height: 1.5;
  color: var(--ink-2);
  margin: 0;
}

.tl-empty__action {
  margin-top: var(--space-2);
}

/* ── Skeleton ────────────────────────────────────────────────────────────── */

/* Placeholders should be the shape of the thing they stand in for, and what
   they mostly stand in for is media — so the default is the media radius, not
   --radius-sm. canva.html passes `border-radius: inherit` inline on its grid
   skeletons, so those keep taking the tile's own shape either way. */
.tl-skeleton {
  display: block;
  position: relative;
  overflow: hidden;
  background: var(--veil-2);
  border-radius: var(--radius-lg);
  color: transparent !important;
  pointer-events: none;
  user-select: none;
}

.tl-skeleton::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    90deg,
    transparent 0%,
    rgba(255, 255, 255, 0.04) 40%,
    rgba(255, 255, 255, 0.07) 50%,
    rgba(255, 255, 255, 0.04) 60%,
    transparent 100%
  );
  transform: translateX(-100%);
  animation: tl-shimmer 1.4s var(--ease-in-out) infinite;
}

.tl-skeleton--text {
  height: 0.85em;
  width: 100%;
  border-radius: var(--radius-pill);
}

.tl-skeleton--title {
  height: 1.25em;
  width: 55%;
  border-radius: var(--radius-pill);
}

.tl-skeleton--avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
}

.tl-skeleton--card {
  height: 120px;
  border-radius: var(--radius-lg);
}

.tl-skeleton--btn {
  height: 40px;
  width: 110px;
  border-radius: var(--radius-pill);
}

@keyframes tl-shimmer {
  100% {
    transform: translateX(100%);
  }
}

/* Opacity only. The spread-ring frames this used to carry were a coloured glow
   around a lime dot, which is the exact thing the language bans. */
@keyframes tl-pulse-dot {
  0%,
  100% {
    opacity: 1;
  }
  50% {
    opacity: 0.4;
  }
}

/* ═══════════════════════════════════════════════════════════════════════════
   LOOP RAIL — signature element
   Five stations: LISTEN → ANALYZE → SCRIPT → RENDER → PUBLISH
   Sizes: data-size="hero" | data-size="compact"
   Station states via data-state on .tl-rail__station:
     idle | active | waiting | running | done
   ═══════════════════════════════════════════════════════════════════════════ */

.tl-rail {
  --rail-track: rgba(255, 255, 255, 0.1);

  /* NOT a shadow. Every `0 0 0 Npx var(--rail-knockout)` below is a MASK that
     punches the 2px track out from behind a station dot, so the line reads as
     five beads on a wire instead of a wire drawn over five beads. It must stay
     OPAQUE and it must stay equal to whatever the rail's own surface resolves
     to — the moment it goes translucent the track draws straight through all
     five dots. --panel is deliberately still #121212 for exactly this, which
     is also what --veil composites to over the ground, so the mask and the
     liquid surface are the same colour by construction. Three sizes use it at
     4px / 6px / 3px and six state rules restate it; they all read this one
     name so the size and the colour can never drift apart again. */
  --rail-knockout: var(--panel);

  --rail-station-gap: clamp(0.5rem, 2vw, 1.5rem);
  --rail-dot: 10px;
  --rail-pad-y: 1.25rem;
  --rail-pad-x: 1rem;
  --rail-label-size: var(--text-xs);
  --rail-count-size: var(--text-sm);
  --rail-meta-size: 0.6875rem;

  position: relative;
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 0;
  width: 100%;
  padding: var(--rail-pad-y) var(--rail-pad-x);
  /* Same name as the mask, on purpose — the surface and the disc punched into
     it can now never be given different values. */
  background: var(--rail-knockout);
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
  overflow: hidden;
  isolation: isolate;
}

/* Horizontal track behind stations */
.tl-rail::before {
  content: "";
  position: absolute;
  left: calc(10% + var(--rail-pad-x) * 0.2);
  right: calc(10% + var(--rail-pad-x) * 0.2);
  top: calc(var(--rail-pad-y) + 1.55rem);
  height: 2px;
  background: var(--rail-track);
  border-radius: var(--radius-pill);
  z-index: 0;
  pointer-events: none;
}

/* Traveling pulse on the track */
.tl-rail__pulse {
  position: absolute;
  left: calc(10% + var(--rail-pad-x) * 0.2);
  right: calc(10% + var(--rail-pad-x) * 0.2);
  top: calc(var(--rail-pad-y) + 1.55rem);
  height: 2px;
  z-index: 1;
  pointer-events: none;
  overflow: hidden;
  border-radius: var(--radius-pill);
}

/* The travelling light itself stays — it is the rail's one piece of signature
   motion. Its two-layer bloom does not: that was a coloured glow. */
.tl-rail__pulse::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 0;
  width: 28%;
  height: 6px;
  transform: translate(-40%, -50%);
  border-radius: var(--radius-pill);
  background: linear-gradient(
    90deg,
    transparent 0%,
    rgba(200, 255, 0, 0.15) 25%,
    var(--signal) 50%,
    rgba(200, 255, 0, 0.15) 75%,
    transparent 100%
  );
  animation: tl-rail-travel 3.6s var(--ease-in-out) infinite;
}

@keyframes tl-rail-travel {
  0% {
    left: 0%;
    opacity: 0;
  }
  8% {
    opacity: 1;
  }
  92% {
    opacity: 1;
  }
  100% {
    left: 100%;
    opacity: 0;
  }
}

/* Station cell */
.tl-rail__station {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 0.55rem;
  min-width: 0;
  padding: 0 0.35rem;
}

.tl-rail__node {
  position: relative;
  width: var(--rail-dot);
  height: var(--rail-dot);
  border-radius: 50%;
  /* An idle dot is a solid tone, not a ring around a faint fill. The 2px stays
     declared because the dot is border-box and the knockout is measured from
     its edge; it is transparent, and the state rules paint it. */
  background: rgba(255, 255, 255, 0.28);
  border: 2px solid transparent;
  box-shadow: 0 0 0 4px var(--rail-knockout);
  flex-shrink: 0;
  transition:
    background var(--dur) var(--ease-out),
    border-color var(--dur) var(--ease-out),
    box-shadow var(--dur) var(--ease-out),
    transform var(--dur) var(--ease-out);
}

.tl-rail__label {
  font-family: var(--font-body);
  font-size: var(--rail-label-size);
  font-weight: var(--w-title);
  color: var(--ink-3);
  line-height: 1.2;
  transition: color var(--dur) var(--ease-out);
}

.tl-rail__count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.3rem;
  font-family: var(--font-body);
  font-size: var(--rail-count-size);
  font-weight: var(--w-title);
  font-variant-numeric: tabular-nums;
  color: var(--ink);
  line-height: 1.2;
  min-height: 1.25em;
}

.tl-rail__glyph {
  font-size: 0.85em;
  line-height: 1;
  opacity: 0.9;
}

/* The status glyph is the one thing in the count that carries state colour —
   tl.js emits "●" for active/running and "⏸" for waiting, and a caller can pass
   its own for done. Everything else in the count stays ink. */
.tl-rail__station[data-state="active"] .tl-rail__glyph,
.tl-rail__station[data-state="running"] .tl-rail__glyph {
  color: var(--signal);
}

.tl-rail__station[data-state="waiting"] .tl-rail__glyph {
  color: var(--ember);
}

.tl-rail__station[data-state="done"] .tl-rail__glyph {
  color: var(--ok);
}

.tl-rail__meta {
  font-family: var(--font-body);
  font-size: var(--rail-meta-size);
  font-weight: 400;
  color: var(--ink-3);
  line-height: 1.3;
  max-width: 9ch;
}

/* Station states.
   The dot is a solid fill in every state, so no state depends on a border to be
   seen. The knockout is restated in each rule only because box-shadow is not
   additive — the size changes per rail size, the colour never does. */
.tl-rail__station[data-state="active"] .tl-rail__node,
.tl-rail__station[data-state="running"] .tl-rail__node {
  background: var(--signal);
  border-color: var(--signal);
  box-shadow: 0 0 0 4px var(--rail-knockout);
}

/* running is the only state that moves. active is lit but settled, so the two
   stay distinguishable now that neither of them has a halo. */
.tl-rail__station[data-state="running"] .tl-rail__node {
  animation: tl-node-glow 1.8s var(--ease-in-out) infinite;
}

/* Full-strength ink against every other label's --ink-3. The lime stays
   rationed to the dot, which is already a solid fill. */
.tl-rail__station[data-state="active"] .tl-rail__label,
.tl-rail__station[data-state="running"] .tl-rail__label {
  color: var(--ink);
}

.tl-rail__station[data-state="waiting"] .tl-rail__node {
  background: var(--ember);
  border-color: var(--ember);
  box-shadow: 0 0 0 4px var(--rail-knockout);
}

.tl-rail__station[data-state="waiting"] .tl-rail__label {
  color: var(--ember);
}

.tl-rail__station[data-state="waiting"] .tl-rail__count {
  color: var(--ember);
}

.tl-rail__station[data-state="done"] .tl-rail__node {
  background: var(--ok);
  border-color: var(--ok);
  box-shadow: 0 0 0 4px var(--rail-knockout);
}

.tl-rail__station[data-state="done"] .tl-rail__label {
  color: var(--ink-2);
}

.tl-rail__station[data-state="idle"] .tl-rail__count {
  color: var(--ink-2);
}

/* Was a spread-ring glow. It is a lightness pulse on the fill now, so the dot
   never grows past its knockout and nothing blooms onto the rail surface. */
@keyframes tl-node-glow {
  0%,
  100% {
    background: var(--signal);
  }
  50% {
    background: rgba(200, 255, 0, 0.45);
  }
}

/* ── Hero size (landing) ────────────────────────────────────────────────── */

.tl-rail[data-size="hero"] {
  --rail-dot: 14px;
  --rail-pad-y: clamp(1.75rem, 3vw, 2.75rem);
  --rail-pad-x: clamp(1rem, 3vw, 2rem);
  --rail-label-size: clamp(0.6875rem, 0.4vw + 0.6rem, 0.8125rem);
  --rail-count-size: clamp(1.125rem, 1.2vw + 0.7rem, 1.75rem);
  --rail-meta-size: clamp(0.6875rem, 0.2vw + 0.65rem, 0.8125rem);

  /* Flat. The old lime wash plus top-to-bottom gradient meant the surface
     behind the dots was a different colour from the mask punched into it, so
     every knockout showed as a dark disc against the rail. One surface, one
     mask, no seam. A rail is embedded in the page, so no lift either. */
  background: var(--rail-knockout);
  gap: 0.25rem;
}

.tl-rail[data-size="hero"]::before {
  top: calc(var(--rail-pad-y) + 1.85rem);
  height: 2px;
  background: linear-gradient(
    90deg,
    transparent 0%,
    rgba(255, 255, 255, 0.12) 10%,
    rgba(255, 255, 255, 0.12) 90%,
    transparent 100%
  );
}

.tl-rail[data-size="hero"] .tl-rail__pulse {
  top: calc(var(--rail-pad-y) + 1.85rem);
}

.tl-rail[data-size="hero"] .tl-rail__station {
  gap: 0.75rem;
  padding: 0 0.5rem;
}

.tl-rail[data-size="hero"] .tl-rail__node {
  box-shadow: 0 0 0 6px var(--rail-knockout);
}

.tl-rail[data-size="hero"] .tl-rail__station[data-state="active"] .tl-rail__node,
.tl-rail[data-size="hero"] .tl-rail__station[data-state="running"] .tl-rail__node,
.tl-rail[data-size="hero"] .tl-rail__station[data-state="waiting"] .tl-rail__node,
.tl-rail[data-size="hero"] .tl-rail__station[data-state="done"] .tl-rail__node {
  box-shadow: 0 0 0 6px var(--rail-knockout);
}

.tl-rail[data-size="hero"] .tl-rail__meta {
  max-width: 12ch;
}

/* ── Compact size (app top bar) ──────────────────────────────────────────── */

.tl-rail[data-size="compact"] {
  --rail-dot: 8px;
  --rail-pad-y: 0.65rem;
  --rail-pad-x: 0.75rem;
  --rail-label-size: 0.625rem;
  --rail-count-size: 0.8125rem;
  --rail-meta-size: 0.625rem;

  border-radius: var(--radius);
  background: var(--rail-knockout);
  box-shadow: none;
}

.tl-rail[data-size="compact"]::before {
  top: calc(var(--rail-pad-y) + 1.15rem);
  left: 8%;
  right: 8%;
}

.tl-rail[data-size="compact"] .tl-rail__pulse {
  top: calc(var(--rail-pad-y) + 1.15rem);
  left: 8%;
  right: 8%;
}

.tl-rail[data-size="compact"] .tl-rail__pulse::after {
  width: 22%;
  height: 4px;
}

.tl-rail[data-size="compact"] .tl-rail__station {
  gap: 0.35rem;
  padding: 0 0.2rem;
}

.tl-rail[data-size="compact"] .tl-rail__node {
  box-shadow: 0 0 0 3px var(--rail-knockout);
}

.tl-rail[data-size="compact"] .tl-rail__station[data-state="active"] .tl-rail__node,
.tl-rail[data-size="compact"] .tl-rail__station[data-state="running"] .tl-rail__node,
.tl-rail[data-size="compact"] .tl-rail__station[data-state="waiting"] .tl-rail__node,
.tl-rail[data-size="compact"] .tl-rail__station[data-state="done"] .tl-rail__node {
  box-shadow: 0 0 0 3px var(--rail-knockout);
}

.tl-rail[data-size="compact"] .tl-rail__meta {
  display: none;
}

/* When pulse is off (static / reduced motion) */
.tl-rail[data-pulse="off"] .tl-rail__pulse,
.tl-rail.is-static .tl-rail__pulse {
  display: none;
}

/* ── Scroll reveal ───────────────────────────────────────────────────────── */

.tl-reveal {
  opacity: 0;
  transform: translateY(18px);
  transition:
    opacity var(--dur-reveal) var(--ease-out),
    transform var(--dur-reveal) var(--ease-out);
  will-change: opacity, transform;
}

.tl-reveal.is-in {
  opacity: 1;
  transform: translateY(0);
  will-change: auto;
}

/* Stagger helpers — set --tl-delay on the element or use modifiers */
.tl-reveal[data-delay="1"] { transition-delay: 60ms; }
.tl-reveal[data-delay="2"] { transition-delay: 120ms; }
.tl-reveal[data-delay="3"] { transition-delay: 180ms; }
.tl-reveal[data-delay="4"] { transition-delay: 240ms; }
.tl-reveal[data-delay="5"] { transition-delay: 300ms; }
.tl-reveal[data-delay="6"] { transition-delay: 360ms; }

.tl-reveal--fade {
  transform: none;
}

.tl-reveal--up {
  transform: translateY(28px);
}

.tl-reveal--scale {
  transform: translateY(12px) scale(0.98);
}

.tl-reveal--scale.is-in {
  transform: translateY(0) scale(1);
}

/* ── Utility ─────────────────────────────────────────────────────────────── */

.tl-sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* A divider is a band of tone, not a border — --line is transparent, so the old
   value drew nothing at all. Prefer --tl-stack's gap where spacing will do. */
.tl-divider {
  height: 1px;
  background: var(--veil-2);
  border: 0;
  margin: 0;
}

.tl-stack {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}

.tl-row {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  flex-wrap: wrap;
}

/* Ink tiers. --ink-3 is the quietest tier an operator still has to read; --ink-4
   is below AA on the ground and is for decorative micro-copy only. */
.tl-muted {
  color: var(--ink-2);
}

.tl-faint {
  color: var(--ink-3);
}

.tl-quiet {
  color: var(--ink-4);
}

/* Status ink. --signal is rationed to solid fills, so .tl-signal is for the
   rare inline word that names a live thing — not for headings or emphasis. */
.tl-signal {
  color: var(--signal);
}

.tl-ember {
  color: var(--ember);
}

.tl-ok {
  color: var(--ok);
}

.tl-warn {
  color: var(--warn);
}

/* Tonal surfaces, one per nesting level. Reach for these instead of writing a
   raw rgba: --veil is a card or a panel, --veil-2 a control resting inside one,
   --veil-3 that control hovered or selected. Never --veil on --veil. */
.tl-veil {
  background: var(--veil);
}

.tl-veil-2 {
  background: var(--veil-2);
}

.tl-veil-3 {
  background: var(--veil-3);
}

/* ── Gooey cluster ───────────────────────────────────────────────────────────
   Opt-in merge for a tight group of pill controls. tl.js injects the #tl-goo
   filter once per page (an external file:// filter reference is unreliable in
   Chrome).

   `filter` creates a containing block for BOTH position:fixed and
   position:absolute descendants, and a new stacking context. So this class goes
   on a LEAF cluster wrapper only — never on body, .layout, .main, #wrap,
   #studio, #stage, #world, #canvas, #canvasWrap, .sidebar or #rail, and never
   on an ancestor of a fixed popover or of a pan/zoom canvas whose maths reads
   getBoundingClientRect. The alpha threshold in the filter also hard-clips
   translucency, so a goo cluster has to sit on flat --ground or on a --solid
   surface; over a --veil stack it merges into a grey blob.

   GATED on the filter actually existing. tl.js does not inject #tl-goo yet, but
   a page once shipped class="tl-goo" on #zoom and #tools — two live,
   interactive canvas control clusters. An unresolved url() still computes to a
   filter value other than `none`, which creates a stacking context AND a
   containing block for every fixed/absolute descendant, for no visual gain
   whatsoever; whether the element still paints at all is left to the engine.
   `html:has(#tl-goo)` makes the declaration a complete no-op until the defs are
   on the page, and lights it up by itself the moment they are. */
html:has(#tl-goo) .tl-goo {
  filter: url(#tl-goo);
}

/* ── Size transitions ────────────────────────────────────────────────────────
   --ease-out overshoots (y > 1), which is the point everywhere except on width
   and margin: a drawer animating to a fixed width briefly exceeds it and clips
   its own fixed-width contents at the peak. These three are the app's animated
   drawers — canva's #dock, remix's #rail and #inspector — and they get the
   non-overshooting curve. The `html` prefix is deliberate: page <style> blocks
   load after tl.css and declare these as bare ids, so an unqualified rule here
   would lose the tie on document order. */
html #dock,
html #rail,
html #inspector {
  transition-timing-function: var(--ease-size);
}

/* ── Responsive ──────────────────────────────────────────────────────────── */

@media (max-width: 900px) {
  .tl-rail[data-size="hero"] {
    --rail-pad-y: 1.35rem;
    --rail-pad-x: 0.75rem;
    --rail-count-size: 1rem;
  }

  .tl-rail[data-size="hero"] .tl-rail__meta {
    max-width: 8ch;
  }
}

@media (max-width: 640px) {
  .tl-rail {
    --rail-pad-y: 1rem;
    --rail-pad-x: 0.5rem;
    border-radius: var(--radius-lg);
  }

  .tl-rail::before,
  .tl-rail__pulse {
    left: 6%;
    right: 6%;
  }

  .tl-rail[data-size="hero"] .tl-rail__label {
    font-size: 0.5625rem;
  }

  .tl-rail[data-size="hero"] .tl-rail__count {
    font-size: 0.875rem;
  }

  .tl-rail[data-size="hero"] .tl-rail__meta {
    display: none;
  }

  .tl-rail[data-size="compact"] .tl-rail__label {
    font-size: 0.5rem;
  }

  .tl-card {
    padding: var(--space-4);
  }

  .tl-panel__head,
  .tl-panel__body {
    padding-left: var(--space-4);
    padding-right: var(--space-4);
  }

  .tl-table th,
  .tl-table td {
    padding: 0.65rem 0.75rem;
  }

  .tl-btn {
    min-height: 38px;
  }

  .tl-empty {
    padding: var(--space-8) var(--space-4);
  }
}

/* Ultra-narrow — 375px and below */
@media (max-width: 400px) {
  .tl-rail[data-size="hero"],
  .tl-rail[data-size="compact"] {
    --rail-pad-x: 0.35rem;
    --rail-pad-y: 0.85rem;
  }

  .tl-rail__station {
    padding: 0 0.1rem;
    gap: 0.3rem;
  }

  .tl-rail[data-size="hero"] .tl-rail__label {
    font-size: 0.5rem;
  }

  .tl-rail[data-size="hero"] .tl-rail__count {
    font-size: 0.75rem;
  }

  .tl-rail[data-size="compact"] .tl-rail__count {
    font-size: 0.6875rem;
  }

  .tl-btn--lg {
    min-height: 44px;
    width: 100%;
  }
}

/* ── Reduced motion ──────────────────────────────────────────────────────── */

/* This block reaches every page that links tl.css, so every animation and every
   transition introduced by the redesign has to be answerable here. The three
   universal !important lines below already neutralise any new transition on any
   element, including the tonal state carriers, the drawer size curves and the
   :where() pill layer; everything named individually is a keyframe animation or
   an explicit transform, which the universal rules only shorten rather than
   stop. tl.js:19 checks the same query independently. */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    transition-delay: 0ms !important;
    scroll-behavior: auto !important;
  }

  .tl-reveal {
    opacity: 1;
    transform: none;
    transition: none;
    will-change: auto;
  }

  .tl-reveal.is-in {
    opacity: 1;
    transform: none;
  }

  .tl-rail__pulse,
  .tl-rail__pulse::after {
    display: none !important;
    animation: none !important;
  }

  /* The lightness pulse is stopped, but the fill under it stays lit, so a
     running station is still visibly a running station. */
  .tl-rail__station[data-state="active"] .tl-rail__node,
  .tl-rail__station[data-state="running"] .tl-rail__node {
    animation: none !important;
    background: var(--signal);
  }

  .tl-badge--live::before {
    animation: none !important;
    opacity: 1;
  }

  .tl-skeleton::after {
    animation: none !important;
    transform: none;
    background: rgba(255, 255, 255, 0.04);
  }

  /* Belt and braces for the drawers: the universal rule shortens their duration
     to 0.01ms, this removes the curve they would have travelled. */
  html #dock,
  html #rail,
  html #inspector {
    transition: none !important;
  }

  .tl-btn:active,
  .tl-card--interactive:active {
    transform: none;
  }
}

/* ══ FIRST-RUN WALKTHROUGHS ════════════════════════════════════════════════
   A TOUR, NOT A NOTICE. The first version was one card in the middle of the
   screen listing what the studio does, which is a release note: you read it,
   you close it, and nothing on the page has been identified. A walkthrough
   points — the thing being explained is lit, everything else goes dark, and
   the words sit beside it with an arrow.

   Built by TL.walkthrough in tl.js; a studio passes words and a selector per
   step and never touches a class name here. Named .tl-wt-* rather than reusing
   .guide / .step because those are three studios' own local classes with their
   own local values.
   ═══════════════════════════════════════════════════════════════════════ */
.tl-wt-wrap {
  position: fixed;
  inset: 0;
  z-index: 9000;
  /* The app goes inert while the tour runs — a step that says "press this" and
     then lets you press something else is a tour you can walk out the side of.
     No blur: the whole point is that you can see the real UI being pointed at,
     and a blurred page is one you cannot follow. */
  background: rgba(4, 5, 7, 0.62);
  animation: tl-wt-in var(--dur, 240ms) var(--ease-out, cubic-bezier(.2,.8,.2,1));
}
/* When a step has a target the dim comes from the HOLE instead, so the wrap
   goes clear and the cutout carries it. */
.tl-wt-wrap.has-hole { background: transparent; }
@keyframes tl-wt-in { from { opacity: 0 } to { opacity: 1 } }

/* ── THE SPOTLIGHT ────────────────────────────────────────────────────────
   One element with an enormous shadow rather than four panels around a gap:
   one thing to move per step, and no seams at the corners when the target is
   an awkward size. The ring is the same specular the app's glass uses, so the
   lit thing looks lit rather than outlined. */
.tl-wt-hole {
  position: absolute;
  pointer-events: none;
  box-shadow:
    0 0 0 100vmax rgba(4, 5, 7, 0.66),
    inset 0 0 0 1.5px rgba(255, 255, 255, 0.55),
    0 0 0 4px rgba(255, 255, 255, 0.10);
  transition: left var(--dur, 240ms) var(--ease-out, cubic-bezier(.2,.8,.2,1)),
              top var(--dur, 240ms) var(--ease-out, cubic-bezier(.2,.8,.2,1)),
              width var(--dur, 240ms) var(--ease-out, cubic-bezier(.2,.8,.2,1)),
              height var(--dur, 240ms) var(--ease-out, cubic-bezier(.2,.8,.2,1));
}
@media (prefers-reduced-motion: reduce) {
  .tl-wt-wrap, .tl-wt-hole { animation: none; transition: none }
}

/* ── THE CALLOUT ──────────────────────────────────────────────────────── */
.tl-wt-call {
  position: absolute;
  width: min(380px, calc(100vw - 24px));
  padding: 18px 20px 16px;
  border-radius: 18px;
  background:
    linear-gradient(180deg, rgba(255,255,255,0.07), rgba(255,255,255,0.025)),
    rgba(20, 22, 26, 0.92);
  -webkit-backdrop-filter: blur(30px) saturate(126%);
  backdrop-filter: blur(30px) saturate(126%);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.20),
    0 24px 60px rgba(0, 0, 0, 0.6);
}
.tl-wt-call.centred {
  left: 50%; top: 50%;
  transform: translate(-50%, -50%);
  width: min(440px, calc(100vw - 32px));
}
/* The arrow tracks the TARGET, not the callout's own middle — a pointer that
   always leaves from the centre stops pointing the moment the callout is
   clamped against an edge, which is exactly when you need it most. */
.tl-wt-call.above::after,
.tl-wt-call.below::after {
  content: "";
  position: absolute;
  left: var(--arrow, 50%);
  width: 14px; height: 14px;
  margin-left: -7px;
  background: rgba(20, 22, 26, 0.92);
  transform: rotate(45deg);
}
.tl-wt-call.below::after { top: -7px; box-shadow: inset 1px 1px 0 rgba(255,255,255,0.18); }
.tl-wt-call.above::after { bottom: -7px; }

.tl-wt-step-of {
  font-size: 11px; letter-spacing: .07em; text-transform: uppercase;
  color: var(--ink-3); margin-bottom: 8px;
  font-variant-numeric: tabular-nums;
}
.tl-wt-title {
  margin: 0 0 5px;
  font-family: var(--font-display, inherit);
  font-size: 21px; font-weight: 600; letter-spacing: -0.01em;
  color: var(--ink); text-wrap: balance;
}
.tl-wt-lead { margin: 0 0 14px; font-size: 14px; line-height: 1.5; color: var(--ink-2); }
.tl-wt-call h3 { margin: 0 0 5px; font-size: 15.5px; font-weight: 500; color: var(--ink); }
.tl-wt-call p  { margin: 0 0 16px; font-size: 13.5px; line-height: 1.5; color: var(--ink-2); }

/* ── THE HOUSE RULES, on the last step only ───────────────────────────── */
.tl-wt-rules { display: grid; gap: 8px; margin-bottom: 16px; }
.tl-wt-rule {
  display: flex; align-items: center; gap: 11px;
  padding: 11px 12px; border-radius: 12px;
  background: var(--veil, rgba(255,255,255,0.04));
}
.tl-wt-mark { display: grid; place-items: center; flex: none; width: 20px; height: 20px; border-radius: 999px; }
.tl-wt-mark svg { width: 10px; height: 10px; }
.tl-wt-mark.ok { background: #2BB673; color: #061206; }
.tl-wt-mark.no { background: #F0445A; color: #1a0306; }
.tl-wt-rtext b {
  display: block; font-size: 10.5px; font-weight: 500; letter-spacing: .05em;
  text-transform: uppercase; color: var(--ink-2); margin-bottom: 2px;
}
.tl-wt-rtext span { font-size: 12.5px; line-height: 1.4; color: var(--ink); }

/* ── GETTING AROUND ───────────────────────────────────────────────────── */
.tl-wt-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.tl-wt-foot button {
  font-family: var(--font-body, inherit); font-size: 13px; border: 0; cursor: pointer;
  border-radius: var(--radius-pill, 999px);
  transition: background var(--dur-fast, 120ms) var(--ease-out, ease),
              color var(--dur-fast, 120ms) var(--ease-out, ease);
}
.tl-wt-back, .tl-wt-skip {
  padding: 9px 14px; background: none; color: var(--ink-3);
}
.tl-wt-back:hover, .tl-wt-skip:hover { color: var(--ink-2); background: var(--veil-2, rgba(255,255,255,0.05)); }
.tl-wt-next {
  padding: 9px 22px; background: var(--signal); color: var(--on-signal, #04122B); font-weight: 500;
}
.tl-wt-next:hover { filter: brightness(1.07); }
/* Where you are in the tour, without a number to read. */
.tl-wt-dots { display: flex; gap: 5px; }
.tl-wt-dots i {
  width: 5px; height: 5px; border-radius: 999px;
  background: var(--veil-4, rgba(255,255,255,0.2));
  transition: background var(--dur-fast, 120ms) var(--ease-out, ease);
}
.tl-wt-dots i.on { background: var(--ink-2); }
/* The footer is the whole of the way out. There was a full-width "Don’t show
   me again" link under it on the last step; a tour is shown once and never
   again now (the user, 2026-09-29: "there doenst have to be the dont show mw
   again button"), so the footer's Done is the last thing in the callout. */

/* The gate dialog's showcase frame, once it holds a render rather than a brief. */
.tl-gate__frame.has-media { padding: 0; }
.tl-gate__frame.has-media > video,
.tl-gate__frame.has-media > img {
  width: 100%; height: 100%; object-fit: cover; display: block; border-radius: inherit;
}

/* The goo cluster's own exemption reset `background` and `box-shadow` but not
   the blur, because the blur did not exist when it was written. A soft edge is
   exactly what the alpha threshold smears into a smudge, so the filter has to
   go too — otherwise the exemption only half applies. */
body .tl-goo .chip,
body .tl-goo a.chip,
body #zoom .chip,
body #zoom a.chip,
body #zlabel {
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
}


/* ═══════════════════════════════════════════════════════════════════════════
   IRIDESCENCE — the spectral rim
   ───────────────────────────────────────────────────────────────────────────
   A flat blue accent tells you a thing is active. A dichroic edge tells you it
   is MADE OF something: light splitting on the lip of dark glass, the way it
   does on a camera coating or the rim of a lens. It reads as material rather
   than as a state, which is the whole difference between a coloured shape and
   an object.

   Three layers, and each one is doing a job the others cannot:
     · the RING is a conic gradient masked to a hairline — the split itself
     · the BLOOM is the same gradient, blurred and pushed outside, because
       light that splits also spills, and an edge with no spill reads printed
     · the CORE stays near-black, so the spectrum has something dark to sit on;
       over a light fill the colours grey out and the whole effect dies.
   ═══════════════════════════════════════════════════════════════════════════ */
:root {
  --iris: conic-gradient(from 205deg,
      #ff2d55 0deg, #ff9f0a 44deg, #ffd60a 82deg, #30d158 132deg,
      #00c7be 176deg, #32ade6 218deg, #5e5ce6 262deg, #bf5af2 304deg,
      #ff375f 344deg, #ff2d55 360deg);
  --iris-core: radial-gradient(120% 120% at 32% 22%,
      #24262e 0%, #16181d 55%, #0e1013 100%);

  /* DISPERSION, NOT A RAINBOW. --iris above is continuous: nine saturated hues
     at even brightness the whole way round. On a hairline that reads as a
     printed sticker, because real light on a lens rim is DARK for most of the
     circumference and blazing at the few angles where it splits.

     The dark stops are the whole trick. Four bright arcs — warm at 1 o'clock,
     a compressed full spectrum at 4, green-yellow at 7, and the specular white
     at 10 where the highlight lands — with near-black between them.

     Circular wells only. On a pill the dark stops fall on the flat sides and
     it reads as a border that failed to render, so rectangles keep --iris.

     THE STOPS LIVE ON THEIR OWN so a second gradient can be built from the
     same list with a different `from` angle. --iris-disp below is byte-for-byte
     the shipped value once var() is substituted; nothing about the static look
     changes. */
  --iris-arcs:
      #08080a 0deg,   #08080a 26deg,
      #3f6bff 36deg,  #7c5cff 50deg,  #07090f 60deg,
      #08080a 104deg,
      #a63bff 120deg, #3f6bff 132deg, #23d3c0 143deg,
      #7be3a8 153deg, #7ae9ff 163deg, #050a14 174deg,
      #08080a 210deg,
      #7be3a8 222deg, #9ff5c6 234deg, #04090f 244deg,
      #08080a 292deg,
      #eaf8ff 306deg, #ffffff 316deg, #7ae9ff 328deg, #060d11 340deg,
      #08080a 360deg;
  --iris-disp: conic-gradient(from 0deg, var(--iris-arcs));

  /* THE SAME ARCS WITH THE DARK CUT OUT INSTEAD OF PAINTED IN.
     On a circle the near-black gaps are the effect — they are what the well
     already looks like, so the ring simply disappears where it is dark. On a
     button there is already a rim underneath (the glass bevel on ::before),
     and painting #08080a over it punches four black holes in the edge. Making
     the gaps `transparent` instead lets the bevel through, so the button
     always has a complete lip and the prismatic arcs ride over it — which is
     also what kills the old "border that failed to render" problem and lets a
     pill wear this at all.

     Gradient interpolation is premultiplied, so a hue fading to transparent
     does not darken on the way out. */
  --iris-arcs-open:
      transparent 0deg,   transparent 26deg,
      #3f6bff 36deg,  #7c5cff 50deg,  transparent 60deg,
      transparent 104deg,
      #a63bff 120deg, #3f6bff 132deg, #23d3c0 143deg,
      #7be3a8 153deg, #7ae9ff 163deg, transparent 174deg,
      transparent 210deg,
      #7be3a8 222deg, #9ff5c6 234deg, transparent 244deg,
      transparent 292deg,
      #eaf8ff 306deg, #ffffff 316deg, #7ae9ff 328deg, transparent 340deg,
      transparent 360deg;

  /* Angles and brightnesses have to be REGISTERED to be animatable. An
     unregistered custom property interpolates as a string, which means it
     snaps from one value to the next instead of sweeping. Where @property is
     unsupported these keep their initial values and the rim is simply a
     static chrome ring — which is the correct thing to degrade to. */
  /* (declarations live outside :root; see @property below) */

  /* ── LIQUID CHROME ───────────────────────────────────────────────────
     Three tries to get here, so the reasoning is worth keeping.

     A full-spectrum conic rotating at one speed is a WHEEL — the eye finds
     the period in about two seconds. Soft green-violet pools fixed the
     wheel but went dim and broadly coloured, which is light, not metal.

     Metal is the third thing. A specular highlight on polished chrome is
     near-WHITE at its core and splits into a spectrum at its edges: violet
     and blue lead, green through the middle, then yellow, orange and red
     trail. That asymmetric fringe is the entire tell. Two-tone reads as a
     coloured glow; the full sequence reads as a surface. The bands are only
     a few degrees wide because on chrome the whole event is small, and the
     ring is near-black between them because unlit metal is dark, not grey.

     So the colour barely changes — it stays silver — and all the chroma
     lives in the fringes. That is the difference between chrome and paint. */
  --chrome-a: conic-gradient(from 0deg,
      #08080a   0deg, #08080a  20deg,
      #3a1d7a  27deg, #2563eb  33deg, #22d3ee  38deg, #86efac  43deg,
      #f0fff4  47deg, #ffffff  51deg, #eaf2ff  55deg,
      #67e8f9  60deg, #3f6bff  66deg, #3b82f6  72deg, #0b1440 79deg,
      #08080a  88deg, #08080a 134deg,
      #4c1d95 143deg, #3b82f6 149deg, #2dd4bf 155deg, #a7f3d0 160deg,
      #ffffff 165deg, #e6f0ff 170deg,
      #22d3ee 176deg, #4f7dff 182deg, #2a3fb0 188deg,
      #08080a 197deg, #08080a 262deg,
      #2b1b6e 270deg, #3f7fe8 276deg, #67e8f9 282deg,
      #ffffff 288deg, #ffeecc 293deg,
      #ffab4a 299deg, #d9531e 305deg, #3a0d05 312deg,
      #08080a 322deg, #08080a 360deg);

  /* A second, fainter pass. Two highlights sliding at a different rate is
     what stops the metal looking like a printed ring that happens to turn. */
  --chrome-b: conic-gradient(from 0deg,
      rgba(255,255,255,0)    0deg, rgba(255,255,255,0)  100deg,
      rgba(120,170,255,.34)120deg, rgba(255,255,255,.62)136deg,
      rgba(255,200,130,.38)152deg, rgba(255,255,255,0)  178deg,
      rgba(255,255,255,0)  302deg,
      rgba(180,215,255,.30)324deg, rgba(255,255,255,.46)338deg,
      rgba(255,210,160,.28)351deg, rgba(255,255,255,0)  360deg);

  /* The well the ring sits on. Near-black and NEUTRAL: any hue here competes
     with the ring, which is the only thing meant to carry colour. */
  --iris-well: radial-gradient(120% 120% at 32% 22%,
      #1c1d21 0%, #121316 55%, #0a0a0c 100%);
}

/* The ring. inset:-1px so the gradient sits ON the edge rather than inside
   it, and the mask cuts everything but the hairline away. */
.iris { position: relative; border-radius: 50%; background: var(--iris-well);
        isolation: isolate; }
.iris::before {
  content: ""; position: absolute; inset: -1.5px; border-radius: inherit;
  background: var(--iris-disp);
  -webkit-mask: radial-gradient(closest-side, transparent calc(100% - 3px),
                                #000 calc(100% - 2.2px));
          mask: radial-gradient(closest-side, transparent calc(100% - 3px),
                                #000 calc(100% - 2.2px));
  z-index: 1; pointer-events: none;
}
/* The spill. Blurred, pushed out, and kept faint — at full strength it stops
   being light and becomes a sticker. */
.iris::after {
  content: ""; position: absolute; inset: -7px; border-radius: inherit;
  background: var(--iris-disp); filter: blur(9px) saturate(.9) brightness(1.15);
  opacity: .46;
  /* Masked to a ring. z-index:-1 does NOT put this behind the parent's
     background once isolation:isolate has made a stacking context, so an
     unmasked disc bleeds colour across the middle of the well. */
  -webkit-mask: radial-gradient(closest-side, transparent 56%, #000 76%);
          mask: radial-gradient(closest-side, transparent 56%, #000 76%);
  z-index: -1; pointer-events: none;
}
.iris > * { position: relative; z-index: 2; }

/* A pill or a card wearing the same edge. Not a circle, so the mask is a
   border-box inset rather than a radial one. */
.iris-edge { position: relative; isolation: isolate; }
.iris-edge::before {
  content: ""; position: absolute; inset: -1px; border-radius: inherit;
  padding: 1.4px; background: var(--iris);
  filter: saturate(1.35) brightness(1.06);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
          mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor; mask-composite: exclude;
  z-index: 1; pointer-events: none; opacity: .85;
}
.iris-edge::after {
  content: ""; position: absolute; inset: -5px; border-radius: inherit;
  background: var(--iris); filter: blur(11px) saturate(1.4); opacity: .26;
  z-index: -1; pointer-events: none;
}

@property --shine { syntax: '<percentage>'; initial-value: -45%; inherits: false }
@property --lq1 { syntax: '<percentage>'; initial-value: 18%; inherits: false }
@property --lq2 { syntax: '<percentage>'; initial-value: 72%; inherits: false }
@property --f1 { syntax: '<angle>';  initial-value: 0deg; inherits: false }
@property --f2 { syntax: '<angle>';  initial-value: 0deg; inherits: false }
@property --o1 { syntax: '<number>'; initial-value: .35; inherits: false }
@property --o2 { syntax: '<number>'; initial-value: .35; inherits: false }

/* ── THE RAIL WELL ────────────────────────────────────────────────────────
   One definition for the icon tiles in every rail. It used to be written once
   per rail, each copy scoped to that rail's id, and a rail left off one colour
   rule had no well at all. Id-scoping a thing that is not id-specific is what
   made that possible; unscoped, the bug cannot be written.

   .cs-ic appears nowhere but those rails, so the bare class is safe here. */
.cs-ic { width: var(--rail-icon-size, 24px); height: var(--rail-icon-size, 24px); border-radius: 50%; flex: none;
  display: grid; place-items: center; color: #f2f4f8;
  position: relative; isolation: isolate; overflow: visible;
  transform: var(--rail-icon-transform, none);
  transition: transform 180ms var(--ease-out);
  background: var(--iris-well);
  /* NO HALO. There was a breathing box-shadow here in warm white, and on a
     near-black ground it did not read as bloom — it read as a white smudge
     behind each tile, which is the same failure the blurred-gradient spill
     had before it. Chrome does not need a lamp behind it: the specular in the
     rim IS the light. What is left is a tight dark contact shadow, so the tile
     still sits ON the panel rather than floating in front of it. */
  box-shadow: 0 1px 3px rgba(0,0,0,.55); }

.cs-ic svg { width: var(--rail-glyph-size, 13px); height: var(--rail-glyph-size, 13px); position: relative; z-index: 3; }
/* TWO OF THE FOUR GLYPHS ARE STROKED, NOT FILLED. Home and elements are
   outlines at stroke-width 1.8 on a 24 viewBox, which lands at 0.975px once
   the svg is 13px — a hairline, while generations and favourites are solid
   shapes. The pair read lighter than the other pair, and on a 1x display the
   stroke drops below a device pixel. A CSS declaration beats the presentation
   attribute, so this lifts them without touching the markup. */
.cs-ic svg [stroke] { stroke-width: 2.1; }

/* The rim. Without mask-composite this pseudo is a filled disc that covers the
   whole tile, so it only exists where the compositing does. */
/* THE TILES DO NOT WEAR THE CHROME ANY MORE.

   They had a dispersion rim, two flowing streaks and a hue shift — built
   before there was a chrome BACKGROUND. With the field running behind
   everything, a chrome ring on each icon is the same material stated twice,
   and the rail turned into four small light shows competing with the one
   large one behind them.

   So the chrome went to where it belongs: behind. The tiles are dark wells
   with a white glyph and a hairline, and the field shows through the gaps
   between them. One source of light in a room.

   The tokens (--chrome-a, --chrome-b, --aurora-*) and the flow keyframes are
   still here and still used by the pill rims and .iris — this only stops the
   rail tiles from claiming them. */
.cs-ic::before {
  content: ""; position: absolute; inset: 0; border-radius: inherit;
  padding: 1px;
  background: linear-gradient(160deg,
    rgba(255,255,255,.20), rgba(255,255,255,.05) 45%, rgba(255,255,255,.13));
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
          mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor; mask-composite: exclude;
  z-index: 2; pointer-events: none;
}


/* A whisper of the row's hue, and no more. These were flat mid-tones picked
   when the tile was a filled square; against a rim that is the only coloured
   thing here, a tinted well competes with it. */
.cs-ic.t-home { background: radial-gradient(120% 120% at 32% 22%,#1b1c20,#121316 55%,#0a0a0c) }
.cs-ic.t-gen  { background: radial-gradient(120% 120% at 32% 22%,#161c28,#101319 55%,#08090c) }
.cs-ic.t-el   { background: radial-gradient(120% 120% at 32% 22%,#1c1826,#131117 55%,#0a080c) }
.cs-ic.t-fav  { background: radial-gradient(120% 120% at 32% 22%,#241820,#161016 55%,#0c080a) }

/* Slow drift, so the split moves as though something is turning under it.
   Held to 18s: anything faster reads as an animation rather than as light,
   and stops being ignorable while you are trying to work. */
/* irisTurn animated --irisAngle, a property nothing declared and nothing read;
   irisSpin hue-rotated in place. Both were dead. The rim travels now, above. */
@media (prefers-reduced-motion: no-preference) {
  .iris::before { animation: flowAngle1 13s linear infinite; }
}
/* Motion is the first thing to go. The rim is still there, just still. */
@media (prefers-reduced-motion: reduce) {
  .cs-ic, .cs-ic::before, .cs-ic::after, .iris::before { animation: none; }
  .cs-ic { transition: none; }
}
