/* Structure only: layout and behaviour, no colours, fonts or chrome sizes.
   A theme restyles through theme/default.css (or its own file) and the variables. */
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; height: 100%; overflow: hidden; }
body { overscroll-behavior: none; }
.desk { position: fixed; inset: 0; display: flex; flex-direction: column; user-select: none; -webkit-user-select: none; }
.desk-area { position: relative; flex: 1 1 auto; min-height: 0; overflow: hidden; }
.desk-icons, .desk-wins { position: absolute; inset: 0; }
.desk-wins { pointer-events: none; }
.desk-wins > * { pointer-events: auto; }
.icon { position: absolute; display: flex; flex-direction: column; align-items: center; cursor: default; touch-action: none; outline-offset: -2px; }
.icon-img { display: block; pointer-events: none; }
.icon-label { text-align: center; overflow-wrap: break-word; word-break: normal; pointer-events: none; }
.win { position: absolute; display: flex; flex-direction: column; min-width: 0; min-height: 0; }
.win.minimised { display: none; }
.win.maxed { left: 0 !important; top: 0 !important; width: 100% !important; height: 100% !important; }
.win-title { display: flex; align-items: center; max-width: 100%; touch-action: none; cursor: default; }
.win-title-text { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.win-btn, .win-back { cursor: default; }
.win-back { display: none; }
.win-body { position: relative; flex: 1 1 auto; min-height: 0; overflow: auto; }
.win-body > iframe { display: block; width: 100%; height: 100%; border: 0; }
.win-grip { position: absolute; right: 0; bottom: 0; z-index: 3; touch-action: none; cursor: nwse-resize; }
.win-edge { position: absolute; z-index: 2; touch-action: none; }
.win-edge[data-edge=e] { top: 40px; right: -5px; bottom: 16px; width: 9px; cursor: ew-resize; }
.win-edge[data-edge=s] { left: 0; right: 16px; bottom: -5px; height: 9px; cursor: ns-resize; }
.win.maxed .win-grip, .win.maxed .win-edge, .win:not(.resizable) .win-grip { display: none; }
/* a phone card is placed by the window manager: no resize handles */
.win.phonefit .win-grip, .win.phonefit .win-edge { display: none; }
.win-hint { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.win-title:focus-visible { outline: 2px solid var(--ring-title, var(--title-ink, currentColor)); outline-offset: -2px; }
.win-body:focus { outline: none; }
@media (pointer: coarse) {
  .win-edge { display: none; }
  .win-btn { min-width: 28px; min-height: 28px; }
  .win-grip { width: 28px !important; height: 28px !important; }
}
.dragging iframe { pointer-events: none; }
.win-outline { position: absolute; box-sizing: border-box; border: 2px solid var(--win-ink, #000); transform-origin: 0 0; z-index: 9999; pointer-events: none; transition: none; }
.dragging .win, .icon.moving { transition: none !important; animation: none !important; }
.bar { flex: 0 0 auto; display: flex; align-items: center; position: relative; z-index: 100000; }
.bar-clock { flex: none; }
.bar-tasks { flex: 1 1 auto; min-width: 0; display: flex; overflow: hidden; }
.bar-task { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.menu { position: absolute; left: 0; bottom: 100%; z-index: 3; display: flex; flex-direction: column; max-height: calc(100vh - 60px); overflow: auto; }
.menu[hidden] { display: none; }
.menu-item { display: flex; align-items: center; text-align: left; cursor: default; }
.menu-item img, .menu-item svg { flex: none; }
.dialog { height: 100%; display: flex; flex-direction: column; justify-content: center; }
.dialog.note { justify-content: flex-start; overflow: auto; }
.dialog p { margin: 0; }
.dialog pre { margin: 0; white-space: pre-wrap; font: inherit; }
@media (max-width: 599px) {
  .win-back { display: inline-block; }
  .win-title { flex-direction: row; }
  .menu { left: 0; right: 0; max-height: 65vh; }
  /* the clock keeps its room; too many tasks scroll sideways instead of shrinking past their icon */
  .bar-tasks { overflow-x: auto; overflow-y: hidden; scrollbar-width: none; }
  .bar-tasks::-webkit-scrollbar { display: none; }
  .bar-task { flex: 1 1 0; min-width: 44px; position: relative; }
}
/* narrow phones: a task is its icon only; the full title stays as its name (clipped, not removed) and its tooltip */
@media (max-width: 419px) {
  :root .bar-task-icon { display: block; }
  :root .bar-task:has(.bar-task-icon) { flex: none; min-width: 44px; padding-left: 6px; padding-right: 6px; justify-content: center; gap: 0; }
  .bar-task:has(.bar-task-icon) .bar-task-label { position: absolute; width: 1px; height: 1px; margin: -1px; overflow: hidden; clip-path: inset(50%); }
}

/* crates: the count on the Output icon, and the Bit Bucket's list */
.icon-badge { position: absolute; top: 0; right: 14px; min-width: 18px; padding: 0 4px; text-align: center; font: 700 11px/16px var(--font, sans-serif); background: var(--accent, #080); color: var(--title-ink, #fff); border: 1px solid var(--win-edge-dark, #222); border-radius: var(--radius, 0); pointer-events: none; }
.bucket-list { list-style: none; margin: 6px 0; padding: 4px 6px; max-height: 96px; overflow: auto; font-size: 11px; background: var(--paper, transparent); color: var(--paperink, inherit); border: 1px solid var(--win-edge-dark, #444); }
.bucket-list li { margin: 2px 0; overflow-wrap: anywhere; }
