/* ==========================================================================
   Caldrant site: the live desk
   A replica of the shell at first launch and of the widgets it hosts.
   Every value here was read from Themes/Presets/*.xaml, Themes/Controls.xaml,
   the widget XAML and the C# that composes the shell (see plan Appendix A).
   ========================================================================== */

/* ---- looks: shell tokens (--sh-*) and widget tokens (--uiw-*) ---------- */
/* The default block is quant-studio dark, the product's default look. */
[data-look] {
  --sh-bg: #131722; --sh-surface: #1B2030; --sh-sunken: #0F1420; --sh-line: #2A3247;
  --sh-line-strong: #39415A; --sh-text: #D6DBEA; --sh-dim: #8B93A8; --sh-accent: #4F8DFF;
  --sh-soft: #16233F; --sh-up: #34D399; --sh-down: #F87171; --sh-warn: #FBBF24;
  --sh-info: #22D3EE; --sh-title: #0F1420; --sh-status: #0F1420; --sh-status-text: #8B93A8;
  --sh-focus: #2B4C8F; --sh-scrim: rgba(8, 12, 23, .75); --sh-radius: 6px; --sh-hpx: 12px;

  --uiw-bg: #0F1218; --uiw-surface: #14181F; --uiw-alt: #1B2029; --uiw-fg: #E6E9EF;
  --uiw-muted: #8A93A3; --uiw-faint: #5C6678; --uiw-border: #2C333F; --uiw-strong: #3C4555;
  --uiw-grid: #222A35; --uiw-accent: #3E6BF0; --uiw-accent-hover: #548AF7; --uiw-up: #28C58C;
  --uiw-up-faint: #1E7A56; --uiw-down: #FF5B75; --uiw-down-faint: #B04658; --uiw-warn: #FFB454;
  --uiw-mine: #FFC24B; --uiw-btn: #1B2029; --uiw-btn-hover: #262E3A; --uiw-on-accent: #FFFFFF;

  --uiw-sans: "Segoe UI", system-ui, -apple-system, "Roboto", "Helvetica Neue", sans-serif;
  --uiw-mono: "Cascadia Mono", "Cascadia Code", Consolas, "Spline Sans Mono", ui-monospace, monospace;
}

[data-look$=":light"] {
  --uiw-bg: #F4F6FB; --uiw-surface: #FFFFFF; --uiw-alt: #F5F7FA; --uiw-fg: #1D2430;
  --uiw-muted: #6B7480; --uiw-faint: #98A2B3; --uiw-border: #D4DBE5; --uiw-strong: #B7C0CC;
  --uiw-grid: #E7EBF1; --uiw-accent: #2F6BFF; --uiw-accent-hover: #1F5AE6; --uiw-up: #16A36A;
  --uiw-up-faint: #A5D9C2; --uiw-down: #E04860; --uiw-down-faint: #F2BFC6; --uiw-warn: #D98A00;
  --uiw-mine: #C08A00; --uiw-btn: #F1F4F9; --uiw-btn-hover: #E7ECF4;
}

[data-look="quant-studio:light"] {
  --sh-bg: #EEF1F6; --sh-surface: #FFFFFF; --sh-sunken: #E4E9F2; --sh-line: #D8DFEA;
  --sh-line-strong: #C0CADB; --sh-text: #17222E; --sh-dim: #5C6B7C; --sh-accent: #0B5FFF;
  --sh-soft: #E8F0FF; --sh-up: #0E9F6E; --sh-down: #E02424; --sh-warn: #D97706;
  --sh-info: #0FA3A3; --sh-title: #E4E9F2; --sh-status-text: #8B93A8; --sh-focus: #7FA8FF;
  --sh-scrim: rgba(19, 27, 42, .4);
}
[data-look="desk-light:dark"] {
  --sh-bg: #0D1B2A; --sh-surface: #14263B; --sh-sunken: #0A1522; --sh-line: #24374E;
  --sh-line-strong: #324862; --sh-text: #D9E2EC; --sh-dim: #8899AB; --sh-accent: #2F7FFF;
  --sh-soft: #12253F; --sh-up: #2FBF8F; --sh-down: #FF6B6B; --sh-warn: #F0A24A;
  --sh-info: #22C5BA; --sh-title: #0A1522; --sh-status: #0A1522; --sh-status-text: #8899AB;
  --sh-focus: #2F7FFF; --sh-scrim: rgba(10, 21, 34, .6); --sh-radius: 8px;
}
[data-look="desk-light:light"] {
  --sh-bg: #EEF1F5; --sh-surface: #FFFFFF; --sh-sunken: #F1F4F9; --sh-line: #D8DEE6;
  --sh-line-strong: #C3CCD8; --sh-text: #17222E; --sh-dim: #5C6B7C; --sh-accent: #0B5FFF;
  --sh-soft: #E8F0FF; --sh-up: #0E9F6E; --sh-down: #E02424; --sh-warn: #D97706;
  --sh-info: #0FA3A3; --sh-title: #0D1B2A; --sh-status: #0D1B2A; --sh-status-text: #9FB0C3;
  --sh-focus: #7FA8FF; --sh-scrim: rgba(19, 27, 42, .4); --sh-radius: 8px;
}
[data-look="terminal-classic:dark"] {
  --sh-bg: #06080C; --sh-surface: #0D1117; --sh-sunken: #0A0D13; --sh-line: #1F2733;
  --sh-line-strong: #2A3547; --sh-text: #C9D3DF; --sh-dim: #6B7684; --sh-accent: #FFB000;
  --sh-soft: #332500; --sh-up: #26D07C; --sh-down: #FF5252; --sh-warn: #FFB000;
  --sh-info: #37D0E6; --sh-title: #0A0D13; --sh-status: #0A0D13; --sh-status-text: #8B93A3;
  --sh-focus: #8A6200; --sh-scrim: rgba(4, 4, 16, .7); --sh-radius: 2px; --sh-hpx: 11.5px;
}
[data-look="terminal-classic:light"] {
  --sh-bg: #EFEDE4; --sh-surface: #FBF9F2; --sh-sunken: #E5E1D5; --sh-line: #D2CCBB;
  --sh-line-strong: #B4AC95; --sh-text: #1D2530; --sh-dim: #6E7562; --sh-accent: #B37400;
  --sh-soft: #F3E4C3; --sh-up: #0E7D4F; --sh-down: #C73535; --sh-warn: #B37400;
  --sh-info: #0B7285; --sh-title: #E5E1D5; --sh-status: #1D2530; --sh-status-text: #B9C0CC;
  --sh-focus: #B37400; --sh-scrim: rgba(29, 37, 48, .4); --sh-radius: 2px; --sh-hpx: 11.5px;
}

/* ---- window ----------------------------------------------------------- */
.desk {
  position: relative; overflow: hidden; text-align: left; color: var(--sh-text); background: var(--sh-bg);
  border-radius: 10px; box-shadow: var(--shadow-desk);
  font: 400 12px/1.33 var(--uiw-sans); font-variant-numeric: tabular-nums;
  container: desk / inline-size; transition: background-color .35s, color .35s; }
.desk *, .desk *::before, .desk *::after { box-sizing: border-box; }
.desk h3, .desk h4, .desk p { margin: 0; font: inherit; letter-spacing: 0; }
.desk button { font: inherit; color: inherit; -webkit-tap-highlight-color: transparent; }
.desk .i { width: 12px; height: 12px; flex: none; fill: currentColor; }

.desk__bar { display: flex; align-items: center; height: 30px; padding: 0 6px 0 10px; background: var(--sh-title); transition: background-color .35s; }
.desk__title { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; font-weight: 600; color: var(--sh-text); white-space: nowrap; }
.desk__title .i { color: var(--sh-text); }
.desk__alert { margin-left: 10px; padding: 1px 7px; min-width: 24px; text-align: center; border-radius: 3px;
  background: #E02424; color: #fff; font-size: 9.5px; font-weight: 700; cursor: pointer; border: 0;
  animation: alert-blink .55s ease-in-out infinite alternate; }
.desk__alert[hidden] { display: none; }
@keyframes alert-blink { from { opacity: 1; } to { opacity: .25; } }
.desk__ident { margin-left: auto; padding-left: 8px; font-size: 10.5px; color: var(--sh-dim); white-space: nowrap; }
.desk__caps { display: flex; margin-left: 8px; }
.desk__caps i { display: grid; place-items: center; width: 34px; height: 20px; margin: 0 2px; border-radius: 5px; color: var(--sh-dim); }
.desk__caps svg { width: 10px; height: 10px; stroke: currentColor; stroke-width: 1; fill: none; }
.desk__caps i:hover { background: var(--sh-soft); }
.desk__caps i:last-child:hover { background: #E02424; color: #fff; }

.desk__menu { display: flex; align-items: center; height: 24px; padding-left: 2px; font-size: var(--sh-hpx); color: var(--sh-text); overflow: hidden; }
.desk__menu span { padding: 4px 9px; border-radius: var(--sh-radius); white-space: nowrap; }
.desk__menu span:hover { background: var(--sh-soft); }

.desk__dock { display: flex; height: clamp(440px, 56cqw, 640px); }
.desk__split { flex: none; width: 4px; background: var(--sh-line); }
.group { display: flex; flex-direction: column; min-width: 0; min-height: 90px; }
.group--l { flex: 1.15; }
.group--r { flex: 1; }

/* tabs: 24px strip, active tab takes the pane surface */
.tabs { display: flex; flex: none; height: 24px; border-bottom: 1px solid var(--sh-line); overflow: hidden; }
.tab { appearance: none; border: 0; margin-right: 2px; padding: 2px 6px 2px 10px; display: inline-flex; align-items: center; gap: 6px;
  background: var(--sh-sunken); color: var(--sh-dim); font: 400 var(--sh-hpx)/1 var(--uiw-sans); white-space: nowrap; cursor: pointer; }
.tab .i { color: var(--sh-dim); }
.tab b { font-weight: 400; font-size: 9px; }
.tab.is-active { background: var(--sh-surface); color: var(--sh-text); }
.tab.is-active .i { color: var(--sh-accent); }
.tab[aria-disabled="true"] { cursor: default; }

.pane { flex: 1; display: flex; flex-direction: column; min-height: 0; margin: 4px; overflow: hidden;
  border: 1px solid var(--sh-line); border-radius: var(--sh-radius); background: var(--sh-surface); }
.pane__cap { flex: none; display: flex; align-items: center; height: 24px; padding: 0 2px;
  background: var(--sh-sunken); border-bottom: 1px solid var(--sh-line); font-size: var(--sh-hpx); }
.pane__grip { width: 12px; height: 10px; margin: 0 6px 0 4px; color: var(--sh-dim);
  background: radial-gradient(circle, currentColor .9px, transparent 1.2px) 0 0 / 4px 5px; }
.pane__glyph { width: 12px; height: 12px; margin-right: 6px; color: var(--sh-accent); }
.pane__name { font-weight: 600; color: var(--sh-text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pane__btns { margin-left: auto; display: flex; }
.pane__btns b { display: grid; place-items: center; width: 22px; height: 18px; margin: 0 1px; border-radius: var(--sh-radius);
  color: var(--sh-dim); font-size: 10.5px; line-height: 1; }
.pane__btns b:hover { background: var(--sh-soft); }
.pane__btns b.x { color: var(--sh-down); }
.pane__btns svg { width: 10px; height: 10px; fill: currentColor; }
.pane__body { position: relative; flex: 1; min-height: 0; }

/* ---- status band ------------------------------------------------------ */
.desk__status { display: flex; align-items: center; height: 28px; padding: 0 8px; overflow: hidden; white-space: nowrap;
  background: var(--sh-status); border-top: 1px solid var(--sh-line); font-size: 10.5px; color: var(--sh-status-text);
  transition: background-color .35s; }
.tape { appearance: none; display: flex; align-items: center; margin: 0 8px 0 0; padding: 0; border: 0;
  background: none; color: inherit; font: inherit; cursor: pointer; }
.tape:hover b { color: var(--sh-text); }
.bead { width: 6px; height: 12px; margin-right: 3px; border-radius: 2px; background: var(--sh-up); }
.bead.warn { background: var(--sh-warn); }
.bead.down { background: var(--sh-down); }
.tape b { margin: 0 2px 0 4px; font: 400 10.5px var(--uiw-mono); color: var(--sh-status-text); }
.tape u { font-size: 7.5px; text-decoration: none; }
.sb { margin: 0 8px; }
.sb--layout { width: 190px; text-align: center; }
.sb--clock { width: 92px; text-align: center; }
.sb--ident { width: 170px; text-align: center; }

/* ---- widget page frame ------------------------------------------------ */
.view { position: absolute; inset: 0; overflow: auto; padding: 24px; background: var(--uiw-bg); color: var(--uiw-fg);
  font: 400 12px/1.33 var(--uiw-sans); transition: background-color .35s, color .35s; }
.view--hidden { display: none; }
.view__head { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; margin-bottom: 14px; }
.view__head h3 { font-size: 20px; font-weight: 600; color: var(--uiw-fg); line-height: 1.25; }
.view__lede { margin-top: 2px; font-size: 13px; color: var(--uiw-fg); max-width: 62ch; }
.view__foot { display: flex; align-items: center; gap: 6px; margin-top: 8px; font-size: 12px; color: var(--uiw-muted); }
.view__foot .push { margin-left: auto; font-family: var(--uiw-mono); }
.view__foot .sel { color: var(--uiw-accent); margin-right: 16px; }
.view__bar { display: flex; align-items: center; gap: 10px; margin: 8px 12px; padding-bottom: 8px;
  border-bottom: 1px solid var(--uiw-border); font-size: 13px; font-weight: 600; }
.view__bar .count { font-size: 11px; font-weight: 400; color: var(--uiw-muted); }
.view__bar .push { margin-left: auto; font-size: 11px; font-weight: 400; color: var(--uiw-muted); }
.view__bar .wbtn { margin-left: auto; height: 26px; }
.view__bar .push + .wbtn { margin-left: 10px; }
.dot { flex: none; width: 8px; height: 8px; border-radius: 50%; background: var(--uiw-up); }
.mono { font-family: var(--uiw-mono); }
.up { color: var(--uiw-up); }
.down { color: var(--uiw-down); }

.wbtn { appearance: none; display: inline-flex; align-items: center; height: 31px; padding: 0 12px; border-radius: 4px;
  border: 1px solid var(--uiw-border); background: var(--uiw-btn); color: var(--uiw-fg);
  font: 400 13px var(--uiw-sans); white-space: nowrap; cursor: pointer; }
.wbtn:hover { background: var(--uiw-btn-hover); }
.wbtn--primary { background: var(--uiw-accent); border-color: var(--uiw-accent); color: var(--uiw-on-accent); }
.wbtn--primary:hover { background: var(--uiw-accent-hover); border-color: var(--uiw-accent-hover); }

/* ---- Chart: line series on a time axis --------------------------------- */
.chart-grid { display: grid; grid-template-columns: 1fr; gap: 12px; }
@container desk (min-width: 560px) { .chart-grid { grid-template-columns: repeat(2, 1fr); } }
@container desk (min-width: 1500px) { .chart-grid { grid-template-columns: repeat(4, 1fr); } }
.chart { position: relative; display: flex; flex-direction:column; min-height: 220px; overflow: hidden;
  background: var(--uiw-surface); border: 1px solid var(--uiw-border); border-radius: 8px; }
.chart__plot { position: relative; flex: 1; min-height: 0; }
.chart__plot canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
.chart__status { display: grid; grid-template-columns: 1fr 1fr 1fr; align-items: center; margin: 2px 10px 8px;
  font-size: 12px; color: var(--uiw-muted); }
.chart__status .l { display: flex; align-items: center; gap: 6px; white-space: nowrap; }
.chart__status .c { text-align: center; font-weight: 600; color: var(--uiw-fg); }
.chart__status .r { text-align: right; font-family: var(--uiw-mono); }
@media (pointer: coarse) { .chart { min-height: 260px; } }

/* ---- Ladder ------------------------------------------------------------ */
.ladder { display: flex; flex-wrap: wrap; }
.ltile { width: 270px; margin: 0 10px 10px 0; overflow: hidden; background: var(--uiw-surface);
  border: 1px solid var(--uiw-border); border-radius: 8px; }
.ltile__bar { display: flex; align-items: center; margin: 8px 12px; font-family: var(--uiw-mono); }
.ltile__sym { font-size: 14px; font-weight: 600; color: var(--uiw-fg); }
.ltile__spread { margin-left: auto; font-size: 12px; color: var(--uiw-muted); }
.ltile__x { display: grid; place-items: center; width: 28px; height: 26px; margin-left: 6px; border-radius: 4px;
  border: 1px solid var(--uiw-border); background: var(--uiw-btn); font-family: var(--uiw-sans); font-size: 11px; color: var(--uiw-fg); }
.ltile__x:hover { background: var(--uiw-btn-hover); }
.ltile__head { display: grid; grid-template-columns: 1fr 1fr 1fr; margin: 0 12px 4px; font-size: 10px; font-weight: 600; color: var(--uiw-muted); }
.ltile__head span:nth-child(2) { text-align: center; }
.ltile__head span:nth-child(3) { text-align: right; }
.lrow { position: relative; display: grid; grid-template-columns: 1fr 1fr 1fr; align-items: center; min-height: 22px;
  font-family: var(--uiw-mono); cursor: pointer; user-select: none; }
.lrow.mid { background: var(--uiw-alt); cursor: default; }
.lrow .bar { position: absolute; top: 0; bottom: 0; width: 33.333%; opacity: .2; pointer-events: none; }
.lrow .bar.b { left: 0; background: var(--uiw-up); transform-origin: right; }
.lrow .bar.a { right: 0; background: var(--uiw-down); transform-origin: left; }
.lrow .mine { position: absolute; top: 0; bottom: 0; width: 33.333%; opacity: 0; background: var(--uiw-mine); pointer-events: none; }
.lrow .mine.b { left: 0; transform-origin: left; }
.lrow .mine.a { right: 0; transform-origin: right; }
.lrow .mine.on { opacity: 1; transform: scaleX(.85); }
.lrow .sz, .lrow .px { position: relative; font-size: 11px; color: var(--uiw-fg); }
.lrow .sz.b { text-align: right; padding-right: 6px; }
.lrow .sz.a { padding-left: 6px; }
.lrow .px { text-align: center; font-size: 12px; }
.lrow.mid .px { font-weight: 700; }
.lrow.flash::after { content: ""; position: absolute; inset: 0; background: var(--uiw-mine); animation: lflash .45s linear forwards; pointer-events: none; }
@keyframes lflash { from { opacity: .5; } to { opacity: 0; } }
.ltile__status { display: flex; justify-content: space-between; gap: 10px; margin: 6px 12px 8px; font-size: 11px; color: var(--uiw-muted); }
.ltile__status .r { font-family: var(--uiw-mono); white-space: nowrap; }

/* ---- Matrix: cross-rate board with heat ------------------------------- */
.matrix { overflow-x: auto; overflow-y: hidden; }
.mx { border-collapse: collapse; font-family: var(--uiw-mono); white-space: nowrap; }
.mx th { padding: 6px 5px; border: .5px solid var(--uiw-border); background: var(--uiw-alt);
  font-size: 12px; font-weight: 600; color: var(--uiw-fg); text-align: center; }
.mx th.corner { padding-left: 10px; font-size: 9px; font-weight: 400; text-align: left; }
.mx td { padding: 5px 6px; border: .5px solid var(--uiw-border); text-align: center; line-height: 1.28; cursor: pointer; }
.mx td.blank { cursor: default; }
.mx .m { font-size: 13px; font-weight: 600; }
.mx .c { font-size: 10px; font-family: var(--uiw-sans); }
.mx .ba { font-size: 9px; color: var(--uiw-muted); }

/* ---- Heatmap ----------------------------------------------------------- */
.heatmap { overflow-x: auto; padding: 10px 8px 0; }
.hm__cols, .hm__row { display: flex; margin: 3px 4px; }
.hm__cols span { width: 104px; margin: 0 2px; padding: 2px 0; font-size: 10.5px; font-weight: 700; color: var(--uiw-muted); text-align: center; }
.hm__row { align-items: stretch; }
.hm__base { width: 56px; margin: 0 2px; padding: 9px 6px 0 0; font-size: 10.5px; font-weight: 700; color: var(--uiw-muted); text-align: right; }
.hm { position: relative; width: 104px; margin: 0 2px; padding: 5px 6px; border-radius: 6px; color: var(--uiw-fg); }
.hm--blank { background: transparent; }
.hm::before { content: ""; position: absolute; inset: 0; border-radius: 6px; background: var(--h); opacity: var(--o); }
.hm > span { position: relative; display: block; }
.hm .s { font-size: 11.5px; font-weight: 600; }
.hm .l { font-family: var(--uiw-mono); font-size: 10px; margin-top: 1px; }
.hm .c { font-size: 11px; font-weight: 600; margin-top: 1px; }
.hm.dir { color: #fff; }

/* ---- DealerTile -------------------------------------------------------- */
.dgrid { display: flex; flex-wrap: wrap; }
.dtile { width: 332px; max-width: 100%; margin: 4px 8px; overflow: hidden; background: var(--uiw-surface);
  border: 1px solid var(--uiw-border); border-radius: 8px; }
.dtile__h { display: flex; align-items: center; margin: 10px 14px 8px; }
.led { flex: none; width: 9px; height: 9px; margin-right: 8px; border-radius: 50%; background: var(--uiw-up); }
.dtile__sym { font-size: 15px; font-weight: 600; color: var(--uiw-fg); }
.chip { margin-left: 8px; padding: 1px 4px; border: 1px solid var(--uiw-border); border-radius: 3px;
  font-size: 9px; font-weight: 600; color: var(--uiw-muted); }
.age { margin-left: auto; font-size: 11px; color: var(--uiw-muted); }
.dtile__b { display: grid; grid-template-columns: 1fr 1px 1fr; margin: 4px 10px 12px; }
.dtile__b > i { background: var(--uiw-border); margin: 2px 0; }
.side { display: grid; justify-items: center; align-items: start; padding-top: 6px; }
.side > span { font-size: 10px; font-weight: 600; color: var(--uiw-muted); }
.side > div { display: flex; align-items: start; font-family: var(--uiw-mono); }
.side .big { margin-top: 7px; font-size: 17px; opacity: .62; }
.side .pips { font-size: 32px; font-weight: 600; line-height: 1; }
.side .pipette { margin-top: 3px; font-size: 16px; }
.side--bid { color: var(--uiw-up); } .side--bid .pipette { color: var(--uiw-up-faint); }
.side--ask { color: var(--uiw-down); } .side--ask .pipette { color: var(--uiw-down-faint); }
.dtile__f { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 6px; padding: 7px 14px; background: var(--uiw-alt); border-top: 1px solid var(--uiw-border); }
.dtile__f b { display: block; font-size: 9px; font-weight: 600; color: var(--uiw-muted); }
.dtile__f span { font-family: var(--uiw-mono); font-size: 12.5px; font-weight: 600; color: var(--uiw-fg); white-space: nowrap; }
.dtile__f .mid { color: var(--uiw-accent); }

/* ---- PulseTile --------------------------------------------------------- */
.pgrid { display: flex; flex-direction: column; align-items: center; }
.pstrip { position: relative; width: 600px; max-width: 100%; margin: 4px 8px 8px; overflow: hidden;
  background: var(--uiw-surface); border: 1px solid var(--uiw-border); border-radius: 8px; }
.pstrip__m { display: grid; grid-template-columns: 20px auto 1fr auto 1fr auto; align-items: center; gap: 8px; margin: 8px 12px 11px; }
.pstrip__sym b { display: block; font-size: 13.5px; font-weight: 600; color: var(--uiw-fg); }
.pstrip__sym span { display: block; font-size: 8px; font-weight: 600; color: var(--uiw-muted); }
.pstrip__sym .led { margin: 0 0 4px; }
.px { font-family: var(--uiw-mono); }
.px em { font-style: normal; font-size: 11px; opacity: .62; }
.px b { font-size: 21px; font-weight: 600; line-height: 1; }
.px i { font-style: normal; font-size: 11px; }
.px--bid { color: var(--uiw-up); } .px--bid i { color: var(--uiw-up-faint); }
.px--ask { color: var(--uiw-down); } .px--ask i { color: var(--uiw-down-faint); }
.px--mid { color: var(--uiw-fg); } .px--mid b { font-size: 12.5px; }
.px--mid .age { display: block; margin: 2px 0 0; font-family: var(--uiw-sans); font-size: 9.5px; color: var(--uiw-muted); }
.pstrip__lbl { font-size: 8px; font-weight: 600; color: var(--uiw-muted); margin-bottom: 2px; }
.pstrip__lbl.mid { margin: 0 0 2px; }
.pill { min-width: 54px; padding: 1px 9px; border: 1px solid var(--uiw-border); border-radius: 9px; background: var(--uiw-alt); text-align: center; }
.pill b { display: block; font-family: var(--uiw-mono); font-size: 12.5px; font-weight: 600; color: var(--uiw-fg); }
.pill span { display: block; margin-top: 2px; font-size: 7px; font-weight: 600; color: var(--uiw-muted); }
.pstrip .age { grid-column: 6; margin: 0; justify-self: end; font-size: 9.5px; }
.pstrip__fuse { height: 3px; background: var(--uiw-alt); }
.pstrip__fuse i { display: block; height: 100%; background: var(--uiw-up); transform-origin: left; }

/* ---- SessionClock ------------------------------------------------------ */
.sc__bar { display: flex; align-items: center; margin: 8px 12px; padding: 8px 12px; margin: 0 0 4px;
  background: var(--uiw-surface); border-bottom: 1px solid var(--uiw-border); font-size: 13px; font-weight: 600; }
.sc__bar .mono { margin-left: 10px; font-size: 11px; font-weight: 400; }
.sc { padding: 4px 12px 0; }
.sc__row { display: grid; grid-template-columns: 56px 1fr 110px; align-items: center; margin: 6px 0; font-size: 10px; }
.sc__name { font-size: 11px; font-weight: 700; color: var(--uiw-fg); }
.sc__track { position: relative; height: 26px; min-width: 50px; }
.sc__base { position: absolute; left: 0; right: 0; top: 4px; height: 18px; border-radius: 4px; background: var(--uiw-alt); }
.sc__tick { position: absolute; top: 5px; width: 1px; height: 16px; background: var(--uiw-grid); }
.sc__seg { position: absolute; top: 2px; height: 14px; min-width: 3px; border-radius: 3px; }
.sc__now { position: absolute; top: 0; width: 2px; height: 26px; background: var(--uiw-down); }
.sc__meta { display: grid; justify-items: end; line-height: 1.35; }
.sc__state { font-size: 10px; font-weight: 700; color: var(--uiw-muted); }
.sc__state.open { color: var(--uiw-up); }
.sc__range, .sc__prog { font-family: var(--uiw-mono); color: var(--uiw-muted); }
.sc__foot { padding: 6px 12px; font-size: 10px; color: var(--uiw-muted); background: var(--uiw-alt); }

/* ---- PnlCard ----------------------------------------------------------- */
.pnl { max-width: 440px; margin: 16px auto 0; overflow: hidden; background: var(--uiw-surface);
  border: 1px solid var(--uiw-border); border-radius: 10px; }
.pnl__h { display: flex; align-items: center; gap: 8px; padding: 9px 12px; background: var(--uiw-alt); font-size: 11.5px; font-weight: 600; }
.pnl__h .stamp { margin-left: auto; font-family: var(--uiw-mono); font-size: 10px; font-weight: 400; color: var(--uiw-muted); }
.pnl__hero { margin: 12px 16px 4px; font-family: var(--uiw-mono); font-size: 32px; font-weight: 700; line-height: 1.2; }
.pnl__sub { margin: 0 16px; font-size: 9.5px; color: var(--uiw-muted); }
.pnl__curve { position: relative; height: 96px; margin: 0 12px 8px; }
.pnl__curve svg { position: absolute; inset: 8px 0; width: 100%; height: 80px; overflow: visible; }
.pnl__curve polyline { fill: none; stroke: var(--uiw-up); stroke-width: 2; vector-effect: non-scaling-stroke; stroke-linejoin: round; }
.pnl__curve .hwm { stroke: var(--uiw-muted); stroke-width: 1; stroke-dasharray: 5 4; opacity: .7; vector-effect: non-scaling-stroke; }
.pnl__f { padding: 7px 12px; background: var(--uiw-alt); font-family: var(--uiw-mono); font-size: 10px; color: var(--uiw-muted); }

/* ---- toast region and blocking dialog --------------------------------- */
.toasts { position: absolute; top: 10px; right: 10px; z-index: 40; display: flex; flex-direction: column; align-items: flex-end; pointer-events: none; }
.toast { position: relative; width: 300px; max-width: calc(100cqw - 20px); margin-bottom: 8px; padding: 8px 10px; pointer-events: auto;
  border-radius: 6px; background: var(--sh-surface); border: 1px solid var(--sev, var(--sh-info));
  animation: toast-in .15s ease-out; box-shadow: 0 8px 22px rgb(0 0 0 / .28); }
.toast::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; border-radius: 2px; background: var(--sev, var(--sh-info)); }
.toast.out { animation: toast-out .12s ease-in forwards; }
@keyframes toast-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes toast-out { from { opacity: 1; } to { opacity: 0; } }
.toast__x { position: absolute; top: 8px; right: 8px; font-size: 9px; color: var(--sh-dim); background: none; border: 0; cursor: pointer; }
.toast__t { padding-right: 14px; font-size: 12px; font-weight: 600; color: var(--sh-text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.toast__m { margin-top: 2px; font-size: 11px; color: var(--sh-dim); opacity: .85; }
.toast__a { display: inline-flex; margin-top: 6px; padding: 3px 10px; border: 1px solid var(--sh-accent); border-radius: 6px;
  background: var(--sh-soft); font-size: 11px; color: var(--sh-text); cursor: pointer; }

.scrim { position: absolute; inset: 0; z-index: 50; display: grid; place-items: center; background: var(--sh-scrim); }
.scrim[hidden] { display: none; }
.dialog { width: 440px; max-width: calc(100% - 32px); overflow: hidden; border-radius: 8px;
  background: var(--sh-surface); border: 1px solid var(--sh-line-strong); }
.dialog__h { padding: 10px 16px; background: var(--sh-sunken); font-size: 12px; font-weight: 700; text-transform: uppercase; color: var(--sev, var(--sh-down)); }
.dialog__m { padding: 14px 16px 6px; font-size: 12.5px; color: var(--sh-text); }
.dialog__f { display: flex; justify-content: flex-end; gap: 8px; padding: 10px 16px 14px; }
.dialog__btn { padding: 5px 14px; border-radius: 6px; border: 1px solid var(--sh-line-strong);
  background: var(--sh-surface); font-size: 12px; color: var(--sh-text); cursor: pointer; }
.dialog__btn:hover { background: var(--sh-soft); border-color: var(--sh-accent); }
.dialog__btn--ack { background: var(--sh-accent); border-color: var(--sh-accent); font-weight: 600; }

/* ---- phone: two groups stacked, each scrolling inside ------------------ */
@container desk (max-width: 640px) {
  .desk__dock { flex-direction: column; height: auto; }
  .group { flex: none; height: 340px; }
  .desk__split { width: auto; height: 4px; }
  .desk__ident { display: none; }
  .tabs { overflow-x: auto; scrollbar-width: none; }
  .tabs::-webkit-scrollbar { display: none; }
  .sb--layout, .sb--ident { display: none; }
  .sb--clock { width: auto; margin-left: auto; }
  .view { padding: 12px; }
  .view__head { display: none; }
  .view__lede { display: none; }
  .ltile:nth-child(n+2), .dtile:nth-child(n+2), .pstrip:nth-child(n+2) { display: none; }
}

/* ---- connection flyout: opens above the tape --------------------------- */
.tapefly { position: absolute; left: 8px; bottom: 36px; z-index: 60; width: min(360px, calc(100cqw - 16px)); padding: 10px;
  background: var(--sh-surface); border: 1px solid var(--sh-line-strong); border-radius: 6px;
  box-shadow: 0 16px 38px rgb(0 0 0 / .45); font-size: 10.5px; color: var(--sh-status-text); }
.tapefly__h { display: flex; align-items: center; justify-content: space-between; margin-bottom: 6px; }
.tapefly__h b { font-size: 11.5px; font-weight: 600; color: var(--sh-text); }
.tapefly__h kbd { padding: 1px 5px; border: 1px solid var(--sh-line-strong); border-radius: 3px; font: 400 9px var(--uiw-mono); color: var(--sh-dim); }
.tapefly__s { display: flex; align-items: baseline; margin-bottom: 6px; }
.tapefly__s b { font-family: var(--uiw-mono); font-weight: 400; }
.tapefly__s .down { color: var(--sh-down); }
.tapefly__s .warn { color: var(--sh-warn); }
.tapefly__s .up { color: var(--sh-up); }
.tapefly__s .t { margin-left: auto; font: 400 10px var(--uiw-mono); }
.tapefly__rows { max-height: 220px; overflow-y: auto; }
.tapefly__row { display: flex; align-items: center; gap: 7px; height: 25px; padding: 0 6px; border-radius: 4px; }
.tapefly__row:hover { background: var(--sh-soft); }
.tapefly__row i { flex: none; width: 12px; font-style: normal; font-size: 10px; }
.tapefly__row i.up { color: var(--sh-up); }
.tapefly__row i.warn { color: var(--sh-warn); }
.tapefly__row i.down { color: var(--sh-down); }
.tapefly__row b { font-weight: 400; font-size: 11px; color: var(--sh-text); }
.tapefly__row span { margin-left: auto; font: 400 10px var(--uiw-mono); color: var(--sh-dim); white-space: nowrap; }
.tapefly__f { margin-top: 6px; font-size: 9.5px; color: var(--sh-dim); }
