/* ==========================================================================
   Caldrant site: static previews of the chrome-free widgets
   Sparkline, Gauge, TickerTape, StepNumber, PickList, TagEditor, DateTimeRange,
   PropertyGrid and LogConsole. The controls are built in C#, so every size and
   Uiw.* key here was read from the source under src/Widgets/Caldrant.Wpf.<Widget>.
   A preview fills its container: about 300 × 180 on desktop, 350 × 190 on a phone.
   Load after desk.css (the --uiw-* tokens); the fallbacks cover a page without it.
   ========================================================================== */

.pv { --pv-up: var(--uiw-up, #28C58C); --pv-down: var(--uiw-down, #FF5B75); --pv-warn: var(--uiw-warn, #FFB454);
  --pv-accent: var(--uiw-accent, #3E6BF0); --pv-muted: var(--uiw-muted, #8A93A3); --pv-border: var(--uiw-border, #2C333F);
  --pv-strong: var(--uiw-strong, #3C4555); --pv-grid: var(--uiw-grid, #222A35); --pv-alt: var(--uiw-alt, #1B2029);
  --pv-surface: var(--uiw-surface, #14181F); --pv-btn: var(--uiw-btn, #1B2029); --pv-hover: var(--uiw-btn-hover, #262E3A);
  --pv-sans: var(--uiw-sans, "Segoe UI", system-ui, sans-serif); --pv-mono: var(--uiw-mono, "Cascadia Mono", Consolas, monospace);
  position: relative; box-sizing: border-box; min-height: 180px; padding: 14px; overflow: hidden; border-radius: 8px;
  background: var(--uiw-bg, #0F1218); color: var(--uiw-fg, #E6E9EF);
  font: 400 12px/1.33 var(--pv-sans); font-variant-numeric: tabular-nums; text-align: left; }
.pv *, .pv *::before, .pv *::after { box-sizing: border-box; }
.pv svg { display: block; max-width: none; }
.pv .m { font-family: var(--pv-mono); }
@media (pointer: coarse) { .pv { min-height: 190px; } }

/* ---- Sparkline: DotRadius 2.5, StrokeThickness 1, Inset 3.5, label 10 mono --- */
.pv--sparkline { display: flex; flex-direction: column; justify-content: center; gap: 12px; }
.sp { display: flex; align-items: center; }
.sp svg { flex: 1; min-width: 0; overflow: visible; }   /* the endpoint dot sits on the edge, half outside */
.sp__v { flex: none; min-width: 46px; margin-left: 6.5px; font-size: 10px; color: inherit; }

/* ---- Gauge: ArcStroke 12, RingStroke 10, BarTrack 10, BarPin 18 x 4 ------- */
.pv--gauge { display: flex; align-items: center; gap: 10px; }
.ga__arc { flex: none; width: 132px; height: 124px; }
.ga__bars { flex: 1; min-width: 0; display: grid; gap: 16px; }
.ga__bar { position: relative; height: 52px; padding: 0 2px; font-size: 11px; color: var(--pv-muted); }
.ga__label { position: absolute; top: 0; left: 2px; }
.ga__value { position: absolute; top: 0; right: 2px; font-size: 12px; font-weight: 400; color: inherit; }
.ga__track { position: absolute; top: 21px; left: 2px; right: 2px; height: 10px; background: var(--pv-strong); }
.ga__zone { position: absolute; top: 0; right: 0; bottom: 0; left: 85%; background: var(--pv-warn); opacity: .25; }
.ga__fill { position: absolute; top: 0; left: 0; bottom: 0; width: var(--w); background: var(--g, var(--pv-up)); }
.ga__pin { position: absolute; top: -4px; left: calc(var(--w) - 2px); width: 4px; height: 18px; background: var(--g, var(--pv-up)); }
.ga__delta { position: absolute; top: 35px; right: 2px; font-size: 10.5px; }

/* ---- TickerTape: chip radius 3, padding 7,3, lane gap 26, grid row 26 ---- */
.pv--tickertape { padding: 14px 8px; }
.tt__lane { display: flex; align-items: center; gap: 26px; height: 30px; margin-left: -48px; white-space: nowrap; }
.tt__grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 3px 8px; margin-top: 12px; }
.tt__chip { position: relative; display: flex; align-items: center; height: 23px; min-width: 0; padding: 0 7px; overflow: hidden;
  border: 1px solid var(--pv-border); border-radius: 3px; background: var(--pv-alt); font-family: var(--pv-mono); font-size: 11px; }
.tt__chip::before { content: ""; position: absolute; inset: 0; border-radius: 3px; background: var(--t, var(--pv-up)); opacity: var(--o, 0); }
.tt__chip > span { position: relative; }
.tt__sym { font-weight: 600; }
.tt__last, .tt__chg { margin-left: 6px; }
.tt__chg { color: var(--pv-down); }
.tt__chip.up .tt__chg { color: var(--pv-up); }

/* ---- StepNumber: 26px field with 24x13 pads; BumpPad card 250 wide ------- */
.pv--stepnumber { display: flex; flex-direction: column; align-items: flex-start; gap: 12px; }
.sn { width: 250px; max-width: 100%; padding: 12px; background: var(--pv-surface); border: 1px solid var(--pv-border); border-radius: 8px; }
.sn__v { display: flex; align-items: flex-end; }
.sn__v b { font-size: 24px; font-weight: 600; line-height: 1.2; }
.sn__v span { margin-left: 6px; font-size: 10px; font-weight: 600; color: var(--pv-muted); }
.sn__rail { position: relative; height: 9px; margin: 10px 0 2px; }
.sn__rail::before { content: ""; position: absolute; left: 0; right: 0; top: 3px; height: 3px; border-radius: 1.5px; background: var(--pv-alt); }
.sn__fill { position: absolute; left: 0; top: 3px; width: calc((100% - 9px) * var(--f)); height: 3px; border-radius: 1.5px; background: var(--pv-accent); }
.sn__pin { position: absolute; top: 0; left: calc((100% - 9px) * var(--f)); width: 9px; height: 9px; border-radius: 50%;
  background: var(--pv-accent); border: 1.5px solid var(--pv-surface); }
.sn__pads { display: grid; grid-template-columns: 1fr 6px 1fr; margin-top: 6px; }
.sn__pads b { display: flex; align-items: center; justify-content: center; height: 26px; border: 1px solid var(--pv-border);
  border-radius: 4px; background: var(--pv-btn); font-size: 12px; font-weight: 400; }
.sn__field { display: flex; width: 132px; max-width: 100%; height: 26px; overflow: hidden; border: 1px solid var(--pv-border);
  border-radius: 3px; background: var(--pv-btn); }
.sn__field > span { flex: 1; display: flex; align-items: center; justify-content: center; font-size: 12.5px; }
.sn__pad { display: grid; grid-template-rows: 1fr 1fr; width: 24px; }
.sn__pad i { display: grid; place-items: center; border-top: 1px solid var(--pv-border); font-style: normal; font-size: 7.5px; color: var(--pv-muted); }

/* ---- PickList: input 12px, rows 22, headers 16, picked bar 3 ------------- */
.pv--picklist { min-height: 188px; }
.pl__filter { display: block; width: 100%; height: 26px; margin-bottom: 6px; padding: 0 8px; border: 1px solid var(--pv-strong);
  border-radius: 4px; background: var(--pv-btn); color: inherit; font: 400 12px var(--pv-sans); outline: none; }
.pl__filter:focus { border-color: var(--pv-accent); }
.pl__h { height: 16px; margin: 3px 0 1px; padding: 0 16px 0 6px; font-size: 10px; line-height: 16px; color: var(--pv-muted); }
.pl__row { position: relative; display: flex; align-items: center; height: 22px; padding: 0 16px 0 6px; }
.pl__row.picked::before { content: ""; position: absolute; inset: 0; background: var(--pv-accent); opacity: .09; }
.pl__row.picked::after { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: var(--pv-accent); }
.pl__code, .pl__desc { position: relative; }
.pl__code { font-size: 11px; }
.pl__desc { flex: 1; min-width: 0; margin-left: 8px; font-size: 10px; color: var(--pv-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pl__foot { margin-top: 6px; font-size: 9.5px; color: var(--pv-muted); }

/* ---- TagEditor: box radius 6 padding 5; chip 17 tall radius 4; rows 22 ---- */
.pv--tageditor { min-height: 184px; }
.te__box { display: flex; flex-wrap: wrap; align-items: center; padding: 5px; border: 1px solid var(--pv-border); border-radius: 6px; background: var(--pv-btn); }
.te__chip { position: relative; display: inline-flex; align-items: center; height: 17px; margin: 1px 4px 1px 0; padding: 0 4px 0 8px;
  border: 1px solid var(--pv-accent); border-radius: 4px; }
.te__chip::before { content: ""; position: absolute; inset: 0; border-radius: 3px; background: var(--pv-accent); opacity: .12; }
.te__chip span, .te__chip i { position: relative; font-size: 10.5px; }
.te__chip i { margin-left: 5px; padding: 2px; font-style: normal; font-size: 9px; color: var(--pv-muted); }
.te__typed { min-width: 70px; margin-left: 2px; font-size: 10.5px; }
.te__pop { margin-top: 4px; padding: 5px 6px; border: 1px solid var(--pv-strong); border-radius: 8px; background: var(--pv-surface);
  box-shadow: 0 6px 20px rgb(0 0 0 / .28); }
.te__row { display: flex; align-items: center; height: 22px; padding: 0 16px 0 9px; font-size: 11px; }
.te__row u { font-weight: 600; text-decoration: none; color: var(--pv-accent); }
.te__row em { margin-left: 12px; font-size: 8.5px; font-style: normal; color: var(--pv-muted); }

/* ---- DateTimeRange: root padding 8 radius 8; cells 20 with a 1 margin ------ */
.pv--datetimerange { display: flex; justify-content: center; align-items: flex-start; min-height: 254px; padding: 10px; }
.dr { width: 210px; padding: 8px; border: 1px solid var(--pv-border); border-radius: 8px; background: var(--pv-surface); }
.dr__h { display: flex; justify-content: space-between; margin-bottom: 4px; font-size: 10px; color: var(--pv-muted); }
.dr__esc { padding: 0 4px; border: 1px solid var(--pv-border); border-radius: 3px; font-family: var(--pv-mono); font-size: 9px; line-height: 13px; }
.dr__nav { display: flex; justify-content: space-between; align-items: center; margin-bottom: 2px; }
.dr__nav i { display: grid; place-items: center; width: 18px; height: 16px; margin: 1px; border-radius: 3px; font-style: normal; font-size: 8px; color: var(--pv-muted); }
.dr__nav b { font-size: 10.5px; font-weight: 600; }
.dr__week { display: grid; grid-template-columns: repeat(7, 1fr); margin-bottom: 2px; font-size: 8.5px; color: var(--pv-muted); text-align: center; }
.dr__days { display: grid; grid-template-columns: repeat(7, 1fr); }
.dr__days span { position: relative; display: grid; place-items: center; height: 20px; margin: 1px; border-radius: 3px;
  font-family: var(--pv-mono); font-size: 10px; }
.dr__days span::before { content: ""; position: absolute; inset: 0; border-radius: 3px; background: var(--pv-accent); opacity: 0; }
.dr__days .in::before { opacity: .1; }
.dr__days .end { font-weight: 600; }
.dr__days .end::before { opacity: .22; }
.dr__days .dim { opacity: .38; }
.dr__time { display: flex; justify-content: space-between; margin-top: 6px; }
.dr__spin { display: flex; align-items: center; }
.dr__spin b { min-width: 36px; font-family: var(--pv-mono); font-size: 11px; font-weight: 400; text-align: center; }
.dr__spin div { display: grid; grid-template-rows: 1fr 1fr; }
.dr__spin i { display: grid; place-items: center; width: 16px; height: 12px; margin: 1px; font-style: normal; font-size: 8px; color: var(--pv-muted); }
.dr__arrow { align-self: center; margin: 0 8px; font-size: 10px; color: var(--pv-muted); }

/* ---- PropertyGrid: caption 24, category 20, rows 22 / 26, name cell 168 --- */
.pg__cap { display: flex; align-items: center; height: 24px; padding: 0 12px 0 4px; border-bottom: 1px solid var(--pv-border); font-size: 11.5px; }
.pg__cap b { font-weight: 600; }
.pg__cap span { margin-left: 8px; font-size: 9.5px; color: var(--pv-muted); }
.pg__body { margin: 2px 0 8px; }
.pg__cat { display: flex; align-items: center; height: 20px; margin: 4px 0 2px 4px; font-size: 10px; color: var(--pv-muted); }
.pg__cat i { margin-right: 5px; font-style: normal; font-size: 7.5px; }
.pg__cat em { margin-left: 6px; font-family: var(--pv-mono); font-size: 9px; font-style: normal; opacity: .7; }
.pg__row { display: grid; grid-template-columns: 168px minmax(0, 1fr); align-items: center; height: 22px; padding: 0 4px; }
.pg__row.tall { height: 26px; }
.pg__name { display: flex; align-items: center; min-width: 0; }
.pg__name i { flex: none; min-width: 30px; margin-right: 6px; font-family: var(--pv-mono); font-size: 9px; font-style: normal; color: var(--pv-muted); }
.pg__name span { font-size: 11px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pg__val { display: flex; align-items: center; min-width: 0; margin-left: 8px; padding: 3px 4px 3px 8px; border-left: 1px solid var(--pv-grid); }
.pg__num { display: flex; align-items: stretch; height: 26px; overflow: hidden; border: 1px solid var(--pv-border); border-radius: 3px; background: var(--pv-btn); }
.pg__num > span { display: flex; align-items: center; padding: 0 6px; font-size: 12.5px; }
.pg__pick { display: flex; align-items: center; height: 26px; padding: 0 8px; border: 1px solid var(--pv-strong); border-radius: 4px;
  background: var(--pv-btn); font-family: var(--pv-mono); font-size: 11px; white-space: nowrap; }
.pg__pick::after { content: ""; flex: none; width: 8px; height: 3.5px; margin-left: 6px; background: var(--pv-muted); clip-path: polygon(0 0, 100% 0, 50% 100%); }
.pg__bool { display: grid; place-items: center; flex: none; width: 12px; height: 12px; border: 1px solid var(--pv-border); border-radius: 2px;
  background: var(--pv-btn); font-size: 9px; font-weight: 400; color: var(--pv-accent); }
.pg__chip { display: flex; align-items: center; flex: none; height: 22px; padding: 0 6px; border: 1px solid var(--pv-border); border-radius: 3px;
  background: var(--pv-btn); font-family: var(--pv-mono); font-size: 9.5px; color: var(--pv-accent); }
.pg__sum { min-width: 0; margin-left: 6px; font-size: 10px; color: var(--pv-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ---- LogConsole: header 24, rows 20, filter line 26 ---------------------- */
.pv--logconsole { display: flex; }
.lc { flex: 1; min-width: 0; display: flex; flex-direction: column; overflow: hidden; border: 1px solid var(--pv-border); border-radius: 4px; background: var(--pv-surface); }
.lc__h { display: flex; align-items: center; flex: none; height: 24px; padding: 0 9px; border-bottom: 1px solid var(--pv-border); font-size: 11.5px; }
.lc__h b { font-weight: 600; }
.lc__h > i { margin-left: 6px; font-style: normal; font-size: 9.5px; color: var(--pv-muted); }
.lc__chip { margin-left: 6px; padding: 1px 6px; border: 1px solid var(--pv-border); border-radius: 3px;
  font-family: var(--pv-mono); font-size: 9px; color: var(--pv-muted); white-space: nowrap; }
.lc__h .pause { margin-left: auto; }
.lc__h .esc { padding: 1px 5px; border-color: var(--pv-strong); }
.lc__body { flex: 1; min-height: 0; display: flex; flex-direction: column; justify-content: flex-end; overflow: hidden; background: var(--pv-alt); }   /* the tail */
.lc__row { flex: none; display: grid; grid-template-columns: 76px 42px 78px minmax(0, 1fr); align-items: center; height: 20px; padding: 0 9px;
  font-family: var(--pv-mono); font-size: 10.5px; }
.lc__row .t { font-size: 9.5px; color: var(--pv-muted); }
.lc__row .lv { font-family: var(--pv-sans); font-size: 8.5px; font-weight: 600; color: var(--pv-accent); }
.lc__row .s { font-size: 10px; color: var(--pv-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lc__row .msg { margin-left: 6px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lc__row.warn .lv, .lc__row.warn .msg { color: var(--pv-warn); }
.lc__row.error .lv, .lc__row.error .msg { color: var(--pv-down); }
.lc__f { display: flex; align-items: center; flex: none; height: 26px; border-top: 1px solid var(--pv-border); font-family: var(--pv-mono); }
.lc__f > span { margin: 0 6px 0 9px; font-size: 10px; color: var(--pv-muted); }
.lc__f input { flex: 1; min-width: 0; height: 20px; margin: 3px 8px 3px 0; padding: 0; border: 0; background: transparent; color: inherit;
  font: 400 11px var(--pv-mono); outline: none; }
