/* =====================================================================
   THE TIER BADGES (v9 · Q93; js/ui/tierbadge.js) — the emblems' materials,
   one cut for each ground.

   PAPER IS INK, BLACK IS LIGHT (grounds.md). On the grey deck the seat is a
   lit plate on a cast shadow and the heat is pigment — deep at the walls,
   a whisper at the touch; on matt black the seat is a line of light caught
   on its rim and the heat glows, its walls the brightest. The heat's six
   colours are the field's resting sides (js/ui/dompaint.js → liqOf, Q131),
   read off its ramps per ground and written here as tokens: in gamut by
   construction (every stop of those ramps is inside sRGB for its lightness).
   ===================================================================== */
:root{
  --tbAsk:#d68dad; --tbAskLit:#913b6b; --tbAskSoft:#f6c9da;
  --tbBid:#7ea9e4; --tbBidLit:#345ba6; --tbBidSoft:#bedbfc;
}
html[data-theme="dark"]{
  --tbAsk:#a95e83; --tbAskLit:#dd9bb4; --tbAskSoft:#66324f;
  --tbBid:#3f7ebb; --tbBidLit:#78b9e9; --tbBidSoft:#244773;
}

.tb{--tbRimHi:rgba(var(--lit),1);--tbRimEdge:rgba(var(--ink),.13);--tbRimLo:rgba(var(--ink),.2);
  --tbFace0:var(--panel2);--tbFace1:var(--panel3);--tbSheen:rgba(var(--lit),calc(.5*var(--litK)));
  --tbShade:rgba(var(--shd),calc(.2*var(--shdK)));--tbHead:var(--accentEdge);--tbSpine:rgba(var(--ink),.32);--tbFl:rgba(var(--shd),calc(.28*var(--shdK)));--tbGlint:rgba(var(--lit),1);--tbAskBar:var(--tbAsk);--tbBidBar:var(--tbBid);--tbReed:rgba(var(--ink),.3);--tbKey:rgba(var(--ink),.3);--tbBez:rgba(var(--ink),.55);
  --tbGroove0:rgba(var(--shd),calc(.2*var(--shdK)));--tbGroove1:rgba(var(--lit),calc(.9*var(--litK)));
  --tbGemLit:rgba(var(--lit),.7);--tbLight:rgba(var(--lit),.9);--tbCut:rgba(var(--ink),.36);
  display:inline-block;flex:none;width:var(--tbPx,64px);height:var(--tbPx,64px);line-height:0;vertical-align:middle}
html[data-theme="dark"] .tb{--tbRimHi:rgba(var(--ink),.36);--tbRimEdge:rgba(var(--ink),.12);--tbRimLo:rgba(var(--shd),.7);
  --tbFace0:var(--raise);--tbFace1:var(--panel3);--tbSheen:rgba(var(--lit),.06);
  --tbShade:rgba(var(--shd),.32);--tbHead:var(--accentHi);--tbSpine:rgba(var(--ink),.3);--tbFl:rgba(var(--shd),.5);--tbGlint:rgba(var(--ink),.9);--tbAskBar:var(--tbAskLit);--tbBidBar:var(--tbBidLit);--tbReed:rgba(var(--ink),.2);--tbKey:rgba(var(--ink),.22);--tbBez:rgba(var(--ink),.42);
  --tbGroove0:rgba(var(--shd),.8);--tbGroove1:rgba(var(--ink),.14);
  --tbGemLit:rgba(var(--ink),.5);--tbLight:rgba(var(--ink),.26);--tbCut:rgba(var(--ink),.3)}
.tb-svg{display:block;width:100%;height:100%;overflow:visible}
/* the seat's shadow: cast down on paper, scaled with the badge; on black the rim's light is the depth */
.tb:not([data-locked]) .tb-svg{filter:drop-shadow(0 calc(var(--tbPx,64px)*.012) calc(var(--tbPx,64px)*.012) rgba(var(--shd),calc(.2*var(--shdK)))) drop-shadow(0 calc(var(--tbPx,64px)*.05) calc(var(--tbPx,64px)*.07) rgba(var(--shd),calc(.12*var(--shdK))))}
html[data-theme="dark"] .tb:not([data-locked]) .tb-svg{filter:drop-shadow(0 calc(var(--tbPx,64px)*.04) calc(var(--tbPx,64px)*.08) rgba(var(--shd),.5))}
.tb[data-cut="s"]:not([data-locked]) .tb-svg{filter:drop-shadow(0 .5px .5px rgba(var(--shd),calc(.22*var(--shdK))))}
html[data-theme="dark"] .tb[data-cut="s"]:not([data-locked]) .tb-svg{filter:none}

.tb-rh{stop-color:var(--tbRimHi)} .tb-re{stop-color:var(--tbRimEdge)} .tb-rl{stop-color:var(--tbRimLo)}
.tb-f0{stop-color:var(--tbFace0)} .tb-f1{stop-color:var(--tbFace1)}
.tb-s0{stop-color:var(--tbSheen)} .tb-s1{stop-color:var(--tbSheen);stop-opacity:0}
.tb-h-a2{stop-color:var(--tbAskLit)} .tb-h-a1{stop-color:var(--tbAsk)} .tb-h-a0{stop-color:var(--tbAskSoft)}
.tb-h-b0{stop-color:var(--tbBidSoft)} .tb-h-b1{stop-color:var(--tbBid)} .tb-h-b2{stop-color:var(--tbBidLit)}
.tb-w0{stop-color:var(--tbLight);stop-opacity:0} .tb-w1{stop-color:var(--tbLight)}

/* THE EMBLEMS: Y's one orange where the price is now, lit from the top left; the heat's two sides as the book wears them */
.tb-o0{stop-color:var(--accentHi)} .tb-o1{stop-color:var(--accent2)} .tb-o2{stop-color:var(--accentEdge)}
.tb-a0{stop-color:var(--accent2);stop-opacity:0} .tb-a1{stop-color:var(--accent2)} .tb-a2{stop-color:var(--tbHead)}
.tb-shade{fill:var(--tbShade)}
.tb-bar.a{fill:var(--tbAskBar)} .tb-bar.b{fill:var(--tbBidBar)}
.tb-spine{stroke:var(--tbSpine)}
.tb-shade.h{opacity:.45}
.tb-fl{stroke:var(--tbFl)}
.tb-glint{fill:var(--tbGlint)}
.tb-gemlit{stroke:var(--tbGemLit)}
/* the glows: light on black, nothing at rest on paper (pigment does not glow; it swells once, in the motion) */
.tb-bloom{opacity:0}
html[data-theme="dark"] .tb-bloom{opacity:.5}
.tb-reed{stroke:var(--tbReed)} .tb-key{stroke:var(--tbKey)} .tb-bez{fill:var(--tbBez)}
.tb-groove .g0{stroke:var(--tbGroove0)} .tb-groove .g1{stroke:var(--tbGroove1)}
/* the heat's bloom: light on black, nothing on paper */
.tb-glow{opacity:0} html[data-theme="dark"] .tb-glow{opacity:.55}
.tb-lt{opacity:0}
/* the parts move about their own boxes: the bars out of the axis, the girdle out of its middle, the glint about itself */
.tb-plate,.tb-touch,.tb-spine,.tb-glint{transform-box:fill-box;transform-origin:50% 50%}
.tb-bar{transform-box:fill-box;transform-origin:0 50%}

/* THE HOUR (Desk): the dial in the system's hairline ink, the sweep in the one orange, densest at the rim behind the hand */
.tb{--tbTickMaj:rgba(var(--ink),.5);--tbDialS:rgba(var(--ink),.5);--tbTip:var(--accentHi);--tbLit:rgba(var(--lit),1);--tbEdge:rgba(var(--lit),.95)}
html[data-theme="dark"] .tb{--tbTickMaj:rgba(var(--ink),.55);--tbDialS:rgba(var(--ink),.42);--tbTip:rgba(var(--ink),.95);--tbLit:rgba(var(--ink),.8);--tbEdge:rgba(var(--ink),.5)}
.tb-dial-r,.tb-tick{stroke:var(--tbSpine)} .tb-dial-r.s{stroke:var(--tbDialS)} .tb-tick.maj{stroke:var(--tbTickMaj)}
.tb-q0{stop-color:var(--accent2);stop-opacity:0} .tb-q1{stop-color:var(--accent2);stop-opacity:.2} .tb-q2{stop-color:var(--accentHi);stop-opacity:.78}
html[data-theme="dark"] .tb-q1{stop-opacity:.28} html[data-theme="dark"] .tb-q2{stop-opacity:.95}
.tb-wedge{fill:var(--accent2);opacity:.5}
.tb-tip{fill:var(--tbTip)} .tb-hubl{fill:var(--tbGemLit)}
.tb-sweep,.tb-dial{transform-box:view-box;transform-origin:32px 32px}
.tb-hub{transform-box:fill-box;transform-origin:50% 50%}
/* THE STONE (Edge): each facet lit or shaded by what it catches; its edges hairlines of light */
.tb-lit{fill:var(--tbLit)}
.tb-edges path{stroke:var(--tbEdge)}
.tb-fc{transform-box:fill-box;transform-origin:50% 50%}

/* THE ENGRAVED OUTLINE (locked): cut into the plate, seated by the system's one lit hairline */
.tb-cut{stroke:var(--tbCut)} .tb-cut-f{fill:var(--tbCut)} .tb-cut-f .tb-cut-l{fill:none;stroke:var(--tbCut)}
.tb[data-locked] .tb-svg{filter:var(--smkSeat)}

/* ---------------------------------------------------------------- THE CHIP
   beside the account: the badge, and the plan's name in the legend's cut; the name rolls inside its own clip */
.tb-chip{position:relative;display:inline-flex;flex:none;white-space:nowrap;align-items:center;gap:var(--sp6);height:100%;padding:0 var(--sp8) 0 var(--sp6);overflow:hidden;
  font:var(--fCtlSm);letter-spacing:var(--trCtlSm);text-transform:uppercase;color:var(--text)}
.tb-chip-b{position:relative;display:grid;width:var(--tbChip,18px);height:var(--tbChip,18px)}
.tb-chip-b>.tb{grid-area:1/1}
.tb-chip-b>.tb.out{z-index:1}
.tb-chip-n{position:relative;display:inline-grid;align-items:center;height:1.6em;overflow:hidden}
.tb-chip-n>b{grid-area:1/1;font:inherit;white-space:nowrap}
.tb-chip-n>b.out,.tb-chip-b>.tb.out{pointer-events:none}
.tb-chip-lt{position:absolute;inset:0 auto 0 0;width:40%;opacity:0;pointer-events:none;
  background:linear-gradient(100deg,transparent,var(--tbChipLight,rgba(var(--lit),.85)) 50%,transparent)}
html[data-theme="dark"] .tb-chip-lt{--tbChipLight:rgba(var(--ink),.16)}

:root[data-motion] .tb *,:root[data-motion] .tb-chip *{animation:none!important}
