/* The desk board: desks as cards on a twelve-column grid, rearranged by hand. */
.desk-board{display:grid;grid-template-columns:repeat(12,minmax(0,1fr));gap:18px;align-items:start;margin-bottom:14px}
.widget{grid-column:span var(--span,12);min-width:0;position:relative;border:1px solid var(--rule);border-radius:var(--r-card);background:var(--paper);overflow:hidden}
.widget[data-collapsed=true] .widget-body{display:none}
.widget.dragging{opacity:.5;outline:1px dashed var(--oxblood);outline-offset:2px;pointer-events:none}
.desk-board.rearranging{cursor:grabbing}
.desk-board.rearranging .widget{transition:none}
.widget-bar{display:flex;align-items:center;gap:8px;padding:6px 8px 6px 6px;border-bottom:1px solid var(--rule-2);background:color-mix(in srgb,var(--paper-2) 55%,transparent)}
.widget-bar h2{flex:1;min-width:0;margin:0;font:italic .92rem/1.2 var(--fell);color:var(--ink-2);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.widget-grip{border:0;background:transparent;color:var(--ink-3);font-size:1.05rem;line-height:1;padding:3px 5px;border-radius:4px;cursor:grab;touch-action:none;user-select:none}
.widget-grip:hover{color:var(--ink);background:var(--paper-2)}
.widget-grip:active{cursor:grabbing}
.widget-actions{display:flex;gap:1px}
.widget-actions button{border:0;background:transparent;color:var(--ink-3);cursor:pointer;font-size:.78rem;line-height:1;padding:4px 6px;border-radius:4px}
.widget-actions button:hover{color:var(--ink);background:var(--paper-2)}
.widget-actions button:disabled{opacity:.3;cursor:default}
/* the desks keep their own insides; the card supplies the frame */
.widget-body>*{border:0!important;border-radius:0!important;margin:0!important}
.widget-body>.account-strip{padding:20px 22px}
.widget-body>.chart-panel{min-height:0}
@media(max-width:1100px){.widget{grid-column:span max(6,var(--span,12))}}
@media(max-width:850px){.widget{grid-column:span 12}.desk-board{gap:14px}}

/* drag by the bar; the placeholder is the slot the card will take */
.widget-bar{cursor:grab}
.widget-placeholder{border:1px dashed var(--oxblood);background:color-mix(in srgb,var(--oxblood) 7%,transparent);min-height:56px}
.widget.dragging{opacity:.96;box-shadow:0 18px 50px #0005;outline:0;pointer-events:none;cursor:grabbing}
/* tablet widths: a two-thirds desk takes the row and a one-third desk takes half, so nothing is left beside a gap */
@media(max-width:1100px) and (min-width:851px){.widget[data-span="8"]{grid-column:span 12}.widget[data-span="4"],.widget[data-span="3"]{grid-column:span 6}}
/* level rows: where cards sit side by side (851px and up), the cards in one grid row share the row's height, so a short
   card's frame runs down to its tallest neighbour's foot instead of leaving a hole and starting the next row unevenly.
   The desk inside keeps its own height (nothing is stretched or clipped); the spare space is the card's foot. Two
   exceptions keep their own height: a folded card stays a bar, and the ticket, whose order button and fine print must
   end the card rather than sit above an empty band; beside a taller chart that is the one row allowed to stay uneven. */
@media(min-width:851px){
.desk-board{align-items:stretch}
.widget{display:flex;flex-direction:column}
.widget>.widget-bar{flex:none}
.widget>.widget-body{flex:1 0 auto}
.widget:is([data-collapsed=true],[data-widget=ticket]){align-self:start}
}

/* the chart fills its levelled card: the plot grows into the band a taller ticket would leave, and redraws at that size */
@media(min-width:851px){.widget[data-widget=chart]>.widget-body{display:flex;flex-direction:column}.widget[data-widget=chart] .chart-panel{flex:1 1 auto;display:flex;flex-direction:column}.widget[data-widget=chart] .chart-stage{flex:1 1 auto}}

/* The toolbox: one tile per desk, directly above the board. Quiet chrome in the page's own ink and rules, so the chart
   stays the hero. A desk on the board shows its tile pressed three ways besides colour: a solid edge instead of a dashed
   one, a filled face, and a bar under the name. */
.toolbox{display:flex;align-items:center;gap:6px 12px;margin:0 0 12px;min-width:0}
.toolbox-tiles{flex:1 1 auto;min-width:0;display:flex;flex-wrap:wrap;gap:3px}
.tool-tile{flex:0 0 auto;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:1px;min-width:48px;min-height:34px;padding:3px 4px 4px;border:1px dashed var(--rule);border-radius:6px;background:transparent;color:var(--ink-3);font:500 .6rem/1.1 var(--sans);white-space:nowrap;cursor:pointer;transition:color .12s,border-color .12s,background-color .12s}
.tool-tile .desk-icon{width:16px;height:16px;flex:none}
.tool-tile>span{max-width:100%;overflow:hidden;text-overflow:ellipsis}
.tool-tile .tool-name-short{display:none}
.tool-tile:hover{color:var(--ink);border-color:var(--ink-3)}
.tool-tile[aria-pressed=true]{border-style:solid;border-color:var(--ink-3);background:var(--paper-2);color:var(--ink);box-shadow:inset 0 -2px 0 var(--ink-2)}
.tool-tile:focus-visible{outline:2px solid var(--oxblood);outline-offset:2px}
.toolbox-end{flex:none;display:flex;align-items:center;gap:6px}
.toolbox-reset{font:500 .68rem var(--sans);min-height:30px;padding:5px 12px;border:1px solid var(--rule);border-radius:999px;background:transparent;color:var(--ink-2);cursor:pointer}
.toolbox-layouts{width:104px}
.toolbox-reset:hover{border-color:var(--ink-3);color:var(--ink)}
.toolbox-reset:focus-visible{outline:2px solid var(--oxblood);outline-offset:2px}
/* wider screens: the tiles share the width in two even rows (eleven and ten); the layouts and the reset sit beside them on a
   desktop and under them on a tablet, and a tablet takes a third row rather than clipping a name */
@media(min-width:601px){.toolbox-tiles{display:grid;grid-template-columns:repeat(11,minmax(0,1fr))}.tool-tile{min-width:0}}
@media(min-width:601px) and (max-width:1099px){.toolbox{flex-direction:column;align-items:normal;gap:6px}.toolbox-end{justify-content:flex-end}}
@media(min-width:601px) and (max-width:900px){.toolbox-tiles{grid-template-columns:repeat(auto-fill,minmax(72px,1fr))}}
/* a phone shows one slim Desks bar instead of the grid: how many desks are out and the first few icons. Pressing it
   opens a bottom sheet (desk-sheet.js) that borrows the same tiles, layouts and reset while it is open: a handle, the
   title, the tiles in a compact grid with icon and short name, a line saying what changed, then layouts and reset */
.toolbox-launch{display:none}
@media(max-width:600px){
.toolbox{display:block;margin:0 0 10px}
.toolbox>.toolbox-tiles,.toolbox>.toolbox-end{display:none}
.toolbox-launch{display:flex;align-items:center;gap:7px;width:100%;min-height:40px;padding:0 12px;border:1px solid var(--rule);border-radius:10px;background:color-mix(in srgb,var(--paper-2) 55%,transparent);color:var(--ink);font:500 .78rem/1.2 var(--sans);text-align:left;cursor:pointer}
.toolbox-launch:focus-visible{outline:2px solid var(--oxblood);outline-offset:2px}
.toolbox-launch-icons{display:flex;flex:none}
.toolbox-launch-icons:empty{display:none}
.toolbox-launch-icons .desk-icon{width:20px;height:20px;padding:2px;border:1px solid var(--rule);border-radius:50%;background:var(--paper);color:var(--ink-2)}
.toolbox-launch-icons .desk-icon+.desk-icon{margin-left:-6px}
.toolbox-launch-sep,.toolbox-launch-count{color:var(--ink-2);font-weight:400;white-space:nowrap}
.toolbox-launch-chevron{margin-left:auto;flex:none;width:7px;height:7px;border-top:1.5px solid var(--ink-2);border-right:1.5px solid var(--ink-2);transform:translateY(2px) rotate(-45deg)}
.desk-sheet .toolbox-tiles{display:grid;grid-template-columns:repeat(auto-fill,minmax(52px,1fr));gap:5px}
.desk-sheet .tool-tile{min-width:0;min-height:46px;gap:3px;padding:5px 2px;font-size:.66rem}
.desk-sheet .tool-tile .desk-icon{width:18px;height:18px}
.tool-tile .tool-name{display:none}
.tool-tile .tool-name-short{display:block}
.desk-sheet .toolbox-end{display:flex;justify-content:space-between;gap:10px;padding-top:12px;border-top:1px solid var(--rule-2)}
.desk-sheet .toolbox-layouts{flex:1 1 0;min-width:0;width:auto}
.desk-sheet .toolbox-reset{min-height:36px;padding:5px 16px}
}
/* the sheet itself: a dialog on the top layer, so the sticky header and the page behind stay under it and inert */
.desk-sheet{position:fixed;inset:auto 0 0;margin:0;width:100%;max-width:none;max-height:min(86vh,640px);padding:0;border:0;border-top:1px solid var(--rule);border-radius:16px 16px 0 0;background-color:var(--paper);background-image:var(--grain);color:var(--ink);box-shadow:0 -12px 40px color-mix(in srgb,var(--ink) 18%,transparent);overflow:hidden;flex-direction:column;touch-action:pan-y}
.desk-sheet[open]{display:flex;animation:desk-sheet-up .24s cubic-bezier(.2,.8,.2,1)}
.desk-sheet::backdrop{background:color-mix(in srgb,var(--ink) 32%,transparent);animation:desk-sheet-fade .24s ease-out}
.desk-sheet-head{flex:none;display:grid;grid-template-columns:1fr auto;align-items:center;gap:2px 10px;padding:6px 14px 8px;touch-action:none;user-select:none}
.desk-sheet-handle{grid-column:1/-1;justify-self:center;width:40px;height:4px;margin:4px 0 6px;border-radius:999px;background:var(--rule);position:relative;cursor:grab}
.desk-sheet-handle::before{content:"";position:absolute;inset:-12px -28px}
.desk-sheet-head h2{margin:0;font:italic 1.1rem/1.2 var(--fell);color:var(--ink)}
.desk-sheet-close{min-height:32px;padding:5px 14px;border:1px solid var(--rule);border-radius:999px;background:transparent;color:var(--ink-2);font:500 .72rem var(--sans);cursor:pointer}
.desk-sheet-close:focus-visible{outline:2px solid var(--oxblood);outline-offset:2px}
.desk-sheet-body{flex:1 1 auto;min-height:0;overflow-y:auto;overscroll-behavior:contain;padding:2px 14px max(14px,env(safe-area-inset-bottom))}
.desk-sheet-note{min-height:1.5em;margin:8px 0 4px;font-size:.7rem;line-height:1.5;color:var(--ink-2)}
html.desk-sheet-open,html.desk-sheet-open body{overflow:hidden}
@keyframes desk-sheet-up{from{transform:translateY(100%)}to{transform:none}}
@keyframes desk-sheet-fade{from{opacity:0}to{opacity:1}}
@media(prefers-reduced-motion:reduce){.desk-sheet[open],.desk-sheet::backdrop{animation:none}}
/* the desk that just came out of the box is marked once, under the sticky header when it scrolls into view */
.widget{scroll-margin-top:72px}
.widget.widget-arrived{animation:widget-arrive 1.4s ease-out}
@keyframes widget-arrive{0%,35%{box-shadow:0 0 0 2px var(--oxblood)}100%{box-shadow:0 0 0 2px transparent}}
@media(prefers-reduced-motion:reduce){.tool-tile{transition:none}.widget.widget-arrived{animation:none;box-shadow:0 0 0 2px var(--oxblood)}}
