/* Dashboard v0.3.0: 12-column auto-flow grid; each widget spans 3–12 columns. 2.42.0: 60 columns underneath. */
.grid{grid-template-columns:repeat(60,minmax(0,1fr));grid-auto-flow:row}  /* 2.42.0: 60 = fifths too; widths stay in twelfths (workspace.js setSpan) */
.panel,.card{min-width:0}
@media(max-width:850px){.grid{grid-template-columns:minmax(0,1fr)}.panel{grid-column:1 / -1 !important}}

/* v0.5.0: all dashboard blocks share the same grid and can be reordered. */
.grid > .workspace-unit{grid-column:1 / -1;min-width:0}
.grid > .market-pulse{padding:0}
.grid > .ticker-unit{min-width:0}
.grid > .ticker-unit .pulse-divider{margin:0 0 20px;height:1px}
.grid > .ticker-unit .pulse-divider:last-child,.grid > .ticker-unit .pulse-ticker + .pulse-divider{margin:20px 0 0}
.grid > .ticker-unit .pulse-ticker{margin:0;min-width:0}
body.edit .workspace-unit{outline:1px dashed var(--edit-border);outline-offset:4px;border-radius:10px}
.workspace-editbar{display:none}
body.edit .workspace-editbar{display:flex;align-items:center;justify-content:space-between;background:var(--edit-bg);border:1px solid var(--edit-border);border-radius:8px;padding:8px 12px;margin-bottom:10px;color:var(--text);font-size:13px;cursor:grab}
body.edit .editbar{cursor:grab}
.drag-handle{cursor:grab;user-select:none}
.move-actions{display:none;gap:5px;margin-left:10px}
body.edit .move-actions{display:inline-flex}
.move-actions button{border:1px solid var(--edit-border);border-radius:5px;padding:3px 9px;background:var(--control);color:var(--text);cursor:pointer}
.workspace-dragging{opacity:.48}
.workspace-drop-target{outline:2px solid var(--accent)!important;outline-offset:4px}
@media(max-width:850px){.grid>.workspace-unit{grid-column:1/-1}}

/* v1.0.0-dev.10 — TV wall (?layout=tv): fixed one-screen grid, no scrolling, no editing.
   Pulse tiles + ticker on top; Most traded | Live tape | Heatmap over Winners.
   Sentiment panel, Highlights and Data health are not shown (sentiment is in the Pulse).
   Use a saved custom layout for any other arrangement on a big screen. */
body.tv{height:100vh;overflow:hidden}
/* 2.92.0 (Joel): the header line is shown on the TV too: "NDX MARKET PULSE", the market state and the US / Swedish
   closure chips, a little larger. The controls on the right stay hidden until the pointer is over the line.
   workspace.js fits the grid into the height below it (--tv-top). Before: the whole line was hidden. */
body.tv .top{position:relative;z-index:50;background:var(--bg);min-height:0;padding:8px 22px}
body.tv .top>div{opacity:0;transition:opacity .2s ease}
body.tv .top:hover>div,body.tv .top:focus-within>div{opacity:1}
body.tv .top>strong{font-size:22px;letter-spacing:.02em}
body.tv .top .market-state,body.tv .top .market-calendar-chip{font-size:15px;padding:4px 12px}
body.tv #edit,body.tv #day-summary,body.tv #layout-tools,body.tv .app-version,body.tv #hidden-tray{display:none!important}
body.tv-fixed .grid{height:calc(100vh - var(--tv-top,0px));box-sizing:border-box;padding:14px;gap:12px 14px;align-items:stretch;
  grid-template-columns:repeat(12,minmax(0,1fr));
  grid-template-rows:auto auto minmax(0,1.3fr) minmax(0,1fr);
  grid-template-areas:"p1 p1 p1 p2 p2 p2 p3 p3 p3 p4 p4 p4" "tk tk tk tk tk tk tk tk tk tk tk tk"
    "mo mo mo mo ta ta ta ta he he he he" "mo mo mo mo ta ta ta ta wi wi wi wi"}
body.tv-fixed .grid>.block{grid-column:auto!important;height:auto!important;min-height:0;order:0!important;display:block}
body.tv-fixed .grid>.block[hidden]{display:block}
body.tv-fixed .grid>[data-block="trading_activity"]{grid-area:p1!important}
body.tv-fixed .grid>[data-block="nordic_markets"]{grid-area:p2!important}
body.tv-fixed .grid>[data-block="sentiment_pulse"]{grid-area:p3!important}
body.tv-fixed .grid>[data-block="underlying_flow"]{grid-area:p4!important}
body.tv-fixed .grid>[data-block="ticker"]{grid-area:tk!important}
body.tv-fixed .grid>[data-block="most_traded"]{grid-area:mo!important}
body.tv-fixed .grid>[data-block="trade_tape"]{grid-area:ta!important}
body.tv-fixed .grid>[data-block="heatmap"]{grid-area:he!important}
body.tv-fixed .grid>[data-block="winners"]{grid-area:wi!important}
body.tv-fixed .grid>[data-block="sentiment"],body.tv-fixed .grid>[data-block="highlights"],body.tv-fixed .grid>[data-block="health"]{display:none!important}
body.tv .card{padding:18px 22px 10px;border-radius:20px}
body.tv .card-header h2{font-size:26px}
body.tv .grid>.ticker-unit .pulse-divider{margin:0}
/* 2.19.0: TV mode for any saved layout ("tv" by default). The fixed arrangement above (body.tv-fixed)
   is only used until a "tv" layout has been saved. The layout is scaled to fit one screen (workspace.js). */
body.tv:not(.tv-fixed) .grid{box-sizing:border-box;padding:14px;gap:12px 14px;align-content:start;transform-origin:top left}
body.tv:not(.tv-fixed) .grid>.block[data-fit="content"]{height:var(--fit-max,360px)!important;max-height:none!important}
body.tv:not(.tv-fixed) .grid>.block[data-fit="content"]>.card{height:100%!important;max-height:none!important}
body.tv:not(.tv-fixed) .highlights-list{overflow:hidden!important}
body.tv-loading .grid{visibility:hidden}
#tv-edit{display:none}
body.tv #tv-edit{display:inline-block}

/* 2.20.0: TV mode: the widgets in a row share one height (no tile looks cut short); a little more room
   under the gauge figures. */
body.tv:not(.tv-fixed) .grid{align-items:stretch}
body.tv:not(.tv-fixed) .grid>.pulse-block{display:flex;flex-direction:column;height:auto!important}
body.tv:not(.tv-fixed) .grid>.pulse-block>.pulse-tile{flex:1 1 auto}
body.tv .market-pulse .pulse-ngm-gauge-figures{padding-bottom:6px}

/* 2.23.0: packed layout (workspace.js pack()): 8 px rows, each card spans its own height, gaps filled ("dense"). */
.grid.packed{grid-auto-rows:1px;grid-auto-flow:row dense;row-gap:0!important}
.grid.packed>.block{align-self:start;margin-bottom:var(--pack-gap,14px)}
.grid.packed>.pulse-block{display:flex;flex-direction:column}
.grid.packed>.pulse-block>.pulse-tile{flex:1 1 auto}
body.tv:not(.tv-fixed) .grid.packed>.pulse-block{height:auto!important}

/* 2.24.0: TV mode: the four top widgets size their content to the tile (container units: 1cqw = 1 % of
   the tile's width), so numbers, labels, the gauge and the bars fill the tile and read from a distance. */
body.tv .grid>.market-pulse .pulse-tile{container-type:inline-size}
body.tv .grid>.market-pulse .pulse-tile .pulse-title{font-size:2.9cqw;margin-bottom:1.6cqw}
body.tv .grid>.market-pulse .pulse-v062-state{font-size:inherit}  /* 2.73.0: part of the title */
/* Trading today */
body.tv .grid>.market-pulse .pulse-trading-hero{padding:1cqw 0 1.4cqw}
body.tv .grid>.market-pulse .pulse-trading-hero-top{gap:4cqw}
body.tv .grid>.market-pulse .pulse-trading-hero-number{font-size:17cqw}
body.tv .grid>.market-pulse .pulse-mechanical-counter{gap:.8cqw}
body.tv .grid>.market-pulse .pulse-mechanical-digit{border-radius:1cqw}
body.tv .grid>.market-pulse .pulse-trading-hero-label{font-size:2.5cqw;margin-top:1.2cqw}
body.tv .grid>.market-pulse .pulse-trading-spark{max-width:none;flex:1 1 0;min-width:0}
body.tv .grid>.market-pulse .pulse-trading-spark svg{height:12cqw}
body.tv .grid>.market-pulse .pulse-trading-spark-caption,body.tv .grid>.market-pulse .pulse-trading-spark-axis{font-size:2cqw}
body.tv .grid>.market-pulse .pulse-trading-secondary{gap:3cqw;padding-top:2cqw}
body.tv .grid>.market-pulse .pulse-trading-secondary-item+ .pulse-trading-secondary-item{padding-left:3cqw}
body.tv .grid>.market-pulse .pulse-trading-secondary-label{font-size:2.2cqw}
body.tv .grid>.market-pulse .pulse-trading-secondary-number{font-size:7cqw}
body.tv .grid>.market-pulse .pulse-unit{display:inline;font-size:.36em}
body.tv .grid>.market-pulse .pulse-footnote{font-size:2cqw}
/* Nordic trading share: bigger squares (25 per row) and a large legend */
body.tv .grid>.market-pulse .pulse-nordic-dots{grid-template-columns:repeat(25,minmax(0,1fr));gap:.5cqw;margin-top:.6cqw}
body.tv .grid>.market-pulse .pulse-nordic-dot{border-radius:.5cqw}
body.tv .grid>.market-pulse .pulse-v070-nordic .pulse-nordic-legend{gap:.8cqw;margin-top:1.6cqw}
body.tv .grid>.market-pulse .pulse-nordic-swatch{min-height:4.6cqw}
body.tv .grid>.market-pulse .pulse-nordic-item .pulse-flag-image{width:5.4cqw;height:3.8cqw}
body.tv .grid>.market-pulse .pulse-nordic-item .pulse-nordic-country{font-size:4cqw}
body.tv .grid>.market-pulse .pulse-nordic-count{font-size:3.2cqw}
body.tv .grid>.market-pulse .pulse-nordic-item .pulse-nordic-share{font-size:5cqw}
body.tv .grid>.market-pulse .pulse-nordic-item{grid-template-columns:.8cqw 5.4cqw minmax(0,1fr) auto auto;column-gap:2.2cqw}
body.tv .grid>.market-pulse .pulse-nordic-item .pulse-nordic-share{min-width:3.6em}
/* Retail sentiment: the gauge uses the tile width; shares and score are large */
body.tv .grid>.market-pulse .pulse-ngm-gauge{min-height:0}
body.tv .grid>.market-pulse .pulse-ngm-gauge-svg,body.tv .grid>.market-pulse .pulse-v062-sentiment .pulse-ngm-gauge-svg{width:74cqw;height:auto;max-height:none}
body.tv .grid>.market-pulse .pulse-ngm-gauge-figures{padding:0 .6cqw 1cqw}
body.tv .grid>.market-pulse .pulse-ngm-gauge-side strong{font-size:8cqw}
body.tv .grid>.market-pulse .pulse-ngm-gauge-score-side strong{font-size:6cqw}
body.tv .grid>.market-pulse .pulse-ngm-gauge-side span{font-size:2.3cqw}
/* Underlying flow: large names, values and bars */
body.tv .grid>.market-pulse .pulse-flow-list{gap:1.2cqw}
body.tv .grid>.market-pulse .pulse-flow-row{grid-template-columns:minmax(0,1.3fr) minmax(0,1fr) auto;gap:3cqw;min-height:9cqw}
body.tv .grid>.market-pulse .pulse-flow-name{font-size:4.6cqw;gap:2cqw}
body.tv .grid>.market-pulse .pulse-flow-name .pulse-ticker-asset-icon{width:4.6cqw;height:4.6cqw}
body.tv .grid>.market-pulse .pulse-flow-bar{height:2.6cqw}
body.tv .grid>.market-pulse .pulse-flow-value{font-size:5.4cqw;min-width:4.2em}
/* 2.24.0: TV lists (Most traded, Winners, Live tape) use larger text in the same 76 px rows. */
body.tv{--ndx-font-instrument:19px;--ndx-font-detail:15px;--ndx-font-metric:24px;--ndx-font-badge:11.5px;--ndx-font-column:13px;--ndx-font-update-time:20px}

/* 2.25.0: TV mode: the other cards also size their content to the card.
   Lists (Most traded, Winners, Live tape): text and row height grow with the card width; the card keeps
   its height, so a wide card shows fewer, larger rows (narrow cards keep the 2.24.0 sizes). */
body.tv .grid>.panel{container-type:inline-size}
/* card titles and times: one size on the whole TV, grown with wide layouts like the pulse titles */
body.tv .grid>.panel>.card>.card-header h2{font-size:calc(16px * var(--tv-wide,1))}
body.tv .grid>.panel>.card>.card-header .update strong{font-size:calc(20px * var(--tv-wide,1))}
body.tv .grid>.panel>.card>.card-header .update{font-size:calc(12px * var(--tv-wide,1))}
body.tv .grid>:is([data-key="most_traded"],[data-key="winners"],[data-key="trade_tape"],[data-key="asset_classes"])>.card{
  --ndx-font-instrument:clamp(19px,2.2cqw,40px);--ndx-font-detail:clamp(15px,1.7cqw,30px);
  --ndx-font-metric:clamp(24px,2.8cqw,50px);--ndx-font-badge:clamp(11.5px,1.2cqw,20px);
  --ndx-font-column:clamp(13px,1.25cqw,22px);--row:clamp(76px,8.6cqw,150px);--col-cqw:calc(2.8cqw / 24)}
body.tv .grid>:is([data-key="most_traded"],[data-key="winners"],[data-key="trade_tape"]) .issuer-badge{width:clamp(36px,3.8cqw,64px);height:clamp(36px,3.8cqw,64px);font-size:clamp(11px,1.15cqw,19px);border-radius:clamp(9px,.9cqw,15px)}
body.tv .grid>:is([data-key="most_traded"],[data-key="winners"],[data-key="trade_tape"]) .identity{gap:clamp(4px,.5cqw,9px)}
body.tv .grid>:is([data-key="most_traded"],[data-key="winners"],[data-key="trade_tape"]) .columns{height:clamp(36px,3.4cqw,56px)}
/* Highlights: about one column per 640 px and each card zoomed to fill its column (insights.js tvPage) */
body.tv .highlights-list[style*="--hl-cols"]{grid-template-columns:repeat(var(--hl-cols),minmax(0,1fr))!important}
body.tv .highlights-list>.highlight{zoom:var(--hl-zoom,1.22)}
/* Heatmap: names and shares grow with the tile (each tile is a size container) */
body.tv .grid .heatmap-stage .heat-tile:not(.heat-other){container-type:size;padding:clamp(7px,4cqmin,22px)}
body.tv .grid .heatmap-stage .heat-tile:not(.heat-other):not(.heat-tiny) .heat-name{font-size:clamp(12px,min(11cqw,16cqh),48px)}
body.tv .grid .heatmap-stage .heat-tile:not(.heat-other) .heat-percent{font-size:clamp(15px,min(18cqw,26cqh),84px)}
body.tv .grid .heatmap-stage .heat-tile:not(.heat-other) .heat-icon{width:clamp(14px,5cqmin,30px);height:clamp(14px,5cqmin,30px)}
/* Top 10 ticker: enlarged on wide layouts (workspace.js fitTv sets --tv-wide) */
body.tv:not(.tv-fixed) .grid>.ticker-unit .pulse-ticker{zoom:var(--tv-wide,1)}
/* the Highlights list always fills its card on the TV (the paging measures it) */
body.tv:not(.tv-fixed) .grid>[data-key="highlights"] .highlights-list{flex:1 1 0!important;min-height:0}
