/* panel-wheel.css — the send wheel.
 *
 * Only the static half lives here. Every pill's position is a transform
 * computed per frame in panel-wheel.js from the arc geometry, because it
 * depends on the pill's offset from the selection and cannot be expressed as
 * a fixed rule. Anything here that also gets written from JS would be a second
 * opinion about the same pixel. */

.wheel-anchor {
  position: relative;
  flex: none;
  z-index: 5;              /* over the scrim, which is z-index 2 */
}

/* A zero-size origin pinned to the send button's centre. The button is 30px,
   so 15px in from its top-left. Every pill is absolutely placed from here, so
   the arc costs transforms and nothing else. */
.wheel-pills {
  position: absolute;
  left: 15px;
  top: 15px;
  width: 0;
  height: 0;
}

.wheel-pill {
  position: absolute;
  left: 0;
  top: 0;
  /* The transform chain in panel-wheel.js is written as move-out, turn, then
     anchor — which only composes correctly if each step starts from the pill's
     own corner rather than its centre. */
  transform-origin: 0 0;
  white-space: nowrap;
  border: none;
  cursor: pointer;
  font: 400 var(--fs-2xs)/1 var(--mono);
  letter-spacing: .18em;
  text-transform: uppercase;
  /* Pill height is the whole constraint on how close the arc can sit —
     clearance is roughly 0.293R minus this box's height — so every pixel taken
     off here buys about 3.4 of radius. 4px vertical is what brings the arc in
     to 76 while still clearing by ~5px. */
  padding: 4px 12px;
  border-radius: var(--r-ctl);

  /* Unselected: the near-opaque ground the design specifies, not a surface
     token. These float over the conversation, and --s-card at 5% would let the
     text behind read straight through them. */
  background: rgba(var(--panel-rgb), .94);
  color: var(--t-secondary);
  box-shadow: var(--lit-pill);

  /* Transform and opacity are set from JS every frame; only the easing is
     declared here. The long transform curve is what gives the arc its swing —
     it overshoots slightly and settles, which is the whole gesture. */
  /* The settle is the whole feel: it runs past the mark and eases back, so a
     step reads as the dial being pulled round and catching rather than sliding
     to a stop. The curve is unchanged; only the timings around it moved.
     Rotation rides in `transform` with the position, so a pill turns and
     travels as one movement.

     Opacity is slower than it was and matched to the transform, because a pill
     wrapping to the far end now crosses through zero — at 260ms it blinked;
     at 380 it hands over. */
  transition: transform 420ms cubic-bezier(.22, 1, .28, 1),
              opacity 380ms cubic-bezier(.22, 1, .28, 1),
              background 200ms ease,
              color 200ms ease;
}

/* The selection, in bone — the same treatment the send button itself carries,
   because it is what the send button is about to do. */
.wheel-pill.on {
  background: var(--bone);
  color: var(--ink);
  font-weight: 500;
  box-shadow: 0 10px 26px rgba(0, 0, 0, calc(.5 * var(--shadow-k, 1)));
}

/* Light falling off around the wheel rather than a panel behind it: a masked
   radial that fades to nothing well before its own edge, so it never draws a
   visible rim over the conversation. */
/* Sized from the radius: 2 * (R + 74) with R now 76, centred on the send
   button. It has to reach past the outermost pill or the arc's far end sits on
   undimmed panel and the falloff reads as a hard edge. */
.wheel-scrim {
  position: absolute;
  /* Sized for the FULL circle, whose outermost pill reaches ~160px from the
     button. On the quarter arc the extra is transparent falloff and costs
     nothing; sized for the arc instead, a circled pill would sit on undimmed
     panel. */
  width: 340px;
  height: 340px;
  right: -130px;
  bottom: -115px;
  border-radius: 50%;
  pointer-events: none;
  z-index: 2;
  opacity: 0;
  /* More stops, closer together, easing off rather than stepping. Four stops
     over a 330px circle leaves visible banding between them — the eye reads
     the jumps as rings. These follow roughly a squared falloff, which is what
     light actually does, and the last few are deliberately crowded near the
     edge so it reaches zero without a seam. */
  /* closest-side, NOT the default. radial-gradient() with no size keyword uses
     FARTHEST-CORNER, so on a 340px box the 100% stop sits at the corner (240px)
     rather than the edge (170px) — the fade is only 71% done where the element
     stops, leaving it ~28% opaque at the boundary. That abrupt cut is the edge
     you can see. closest-side lands 100% exactly on the edge. */
  background: radial-gradient(circle closest-side at 50% 50%,
              rgba(var(--ink-rgb), .28) 0%,
              rgba(var(--ink-rgb), .26) 26%,
              rgba(var(--ink-rgb), .21) 42%,
              rgba(var(--ink-rgb), .15) 56%,
              rgba(var(--ink-rgb), .10) 68%,
              rgba(var(--ink-rgb), .06) 78%,
              rgba(var(--ink-rgb), .03) 86%,
              rgba(var(--ink-rgb), .01) 93%,
              rgba(var(--ink-rgb), 0) 100%);
  -webkit-mask-image: radial-gradient(circle closest-side at 50% 50%,
              rgba(0,0,0,1) 0%, rgba(0,0,0,.98) 24%, rgba(0,0,0,.88) 40%,
              rgba(0,0,0,.70) 54%, rgba(0,0,0,.48) 66%, rgba(0,0,0,.28) 76%,
              rgba(0,0,0,.14) 84%, rgba(0,0,0,.05) 92%, rgba(0,0,0,0) 100%);
  mask-image: radial-gradient(circle closest-side at 50% 50%,
              rgba(0,0,0,1) 0%, rgba(0,0,0,.98) 24%, rgba(0,0,0,.88) 40%,
              rgba(0,0,0,.70) 54%, rgba(0,0,0,.48) 66%, rgba(0,0,0,.28) 76%,
              rgba(0,0,0,.14) 84%, rgba(0,0,0,.05) 92%, rgba(0,0,0,0) 100%);
  transition: opacity 280ms ease, backdrop-filter 280ms ease,
              transform 420ms cubic-bezier(.22, 1, .28, 1);
}

.wheel-scrim.open {
  opacity: 1;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

/* Grown for the outer ring, which reaches ~210px where the inner one reaches
   ~137 — past the 170px this circle covers, so without it the second level's
   pills would sit on undimmed panel and the falloff would read as a hard rim
   drawn through them. Scaled rather than resized because the element's centre
   IS the send button's centre: scaling about it keeps the light centred, and
   the mask scales with it so the edge stays soft. */
.wheel-scrim.deep { transform: scale(1.4); }
/* And again for the third ring, which reaches ~340px — past the ~240 that
   `deep` covers. Same light, scaled about the same centre; the classes are
   exclusive (panel-wheel.js sets one per depth), so this is not a
   multiplication of the one above. */
.wheel-scrim.deeper { transform: scale(2); }
/* The arc is the gesture. With motion off, the pills appear and disappear in
   place rather than swinging — the selection is still legible, which is what
   the feature is for. */
@media (prefers-reduced-motion: reduce) {
  .wheel-pill { transition: opacity var(--dur-1) ease; }
  .wheel-scrim { transition: opacity var(--dur-1) ease; }
}

/* ---- the second level ---------------------------------------------------
 *
 * Same origin as .wheel-pills — the button's centre — because it is the same
 * ring at a bigger radius, and two origins would mean converting between
 * frames on every frame. A SIBLING, later in the source, so the outer ring
 * paints over the inner one where the two overlap. */
.wheel-sub {
  position: absolute;
  left: 15px;
  top: 15px;
  width: 0;
  height: 0;
}

/* One of these per level out, inside .wheel-sub — the third ring lives in its
   own host so it can fade out under a ring opening above it without the two
   sharing children. Zero-size at the same origin, so a pill's transform means
   the same thing on every ring. */
.wheel-ring {
  position: absolute;
  left: 0;
  top: 0;
  width: 0;
  height: 0;
}

/* Worn WITH .wheel-pill and adding almost nothing, deliberately: the outer
   ring is the same dial, so it is the same pill. What separates the levels is
   the radius and the inner ring receding behind it, not a second visual
   treatment competing with the selection. */
.wheel-sub-pill {
  /* A shade lighter, and only that: enough to read as being in front where a
     spoke passes near an inner-ring label, invisible everywhere else. */
  background: rgba(var(--panel-hi-rgb), .96);
}

/* The vendor's mark ahead of a model name (pxWheelLogo). Sized here, before
   the image loads, because the ring's reach is measured off the pill the
   moment it is built. Brand colours on a contrasting chip would fight the
   dial, so the mark sits bare; a one-colour mark (OpenAI) is a mask filled
   with the pill's own text colour, so it turns with the selection. */
.wheel-pill--logo {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.wheel-logo {
  flex: none;
  width: 12px;
  height: 12px;
  background: center / contain no-repeat;
}
.wheel-logo--mono {
  background: currentColor;
  -webkit-mask: center / contain no-repeat;
  mask: center / contain no-repeat;
}

/* A model that draws a Pro session down fast ($$ / $$$, from the server).
   Quiet on the ring, louder for the extreme tier; legible on the selection. */
.wheel-cost {
  font-weight: 500;
  letter-spacing: .04em;
  color: var(--t-secondary);
}
.wheel-down, .bp-down { display: inline-flex; margin-left: 6px; color: rgb(var(--warn-rgb)); vertical-align: middle; }
.wheel-down svg, .bp-down svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.wheel-cost--extreme { color: rgb(var(--warn-rgb)); }
.wheel-pill.on .wheel-cost { color: inherit; opacity: .7; }

/* The choice already in force — the model actually selected. Marked rather
   than merely pre-selected: the ring OPENS on it, so .on and .current usually
   coincide, and this is what still says which is which once you scroll off. */
.wheel-sub-pill.current { color: var(--bone); }
.wheel-sub-pill.on.current { color: var(--ink); }
