/* The frame both brand desks share on /services/upkeep/, /3pl/ and /3pl-dashboard/, on top of kit/desk/desk.css. Anything here could be promoted to the kit. */

/* a toast or a sheet can reach past the bottom of the desk: it has to paint over the sections that come after it */
.s > .desk { z-index: 3; }

/* a mouse in a wide window: a record and search open under the top bar, so the label and the bell stay on screen; toasts clear the replay bar */
@media (pointer: fine) and (min-width: 1041px) {
  .desk .d-drawer { top: 46px; }
  .desk .d-scrim { top: 46px; padding-top: 24px; }
  .desk .d-toasts { bottom: 44px; }
}
/* a touch tablet: the desk is as tall as its content, so search has to sit on the screen, not at the top of the desk */
@media (pointer: coarse) and (min-width: 761px), (pointer: fine) and (min-width: 761px) and (max-width: 1040px) {
  .desk .d-scrim { position: fixed; top: var(--bar-h, 64px); z-index: 30; padding-top: 24px; }
}
/* a record on a tablet's desk ends where it ends, rather than running on blank to the foot of a tall screen */
@media (pointer: coarse) and (min-width: 761px), (pointer: fine) and (min-width: 761px) and (max-width: 1040px) { .desk .d-drawer { bottom: auto; max-height: calc(100svh - var(--bar-h, 64px)); border-bottom: 1px solid var(--d-line2); border-bottom-left-radius: var(--d-r2); } }
/* a toast on a tablet's desk rides the bottom of the screen, and at the desk's foot it would land on the replay bar: it sits a bar's height higher */
@media (pointer: coarse) and (min-width: 761px), (pointer: fine) and (min-width: 761px) and (max-width: 1040px) { .desk .d-toasts { translate: 0 -46px; } }
/* a window this narrow with a mouse gets the tablet's desk. A framed desk this small cuts its rows off at the replay bar, and they can only be reached by finding the pane's own scrollbar. Here it grows with the page, and the page does the scrolling */
@media (pointer: fine) and (min-width: 761px) and (max-width: 1040px) {
  .desk { height: auto !important; overflow: visible; }
  .desk__c { height: auto; }
  .desk .d-scroll, .desk:not(.is-engaged) .d-scroll { overflow: visible; scrollbar-gutter: auto; }
  .desk .d-scroll--x, .desk:not(.is-engaged) .d-scroll--x { overflow-x: auto; overflow-y: visible; }
  .d-main { min-height: min(62svh, 640px); }
  .desk.is-playing .d-main, .desk.is-held .d-main { height: min(76svh, 760px); min-height: 0; overflow: hidden; }
  .desk.is-playing .d-scroll, .desk.is-held .d-scroll { overflow: hidden; }
  .d-top { position: sticky; top: var(--bar-h, 64px); z-index: 6; border-radius: 12px 12px 0 0; }
  .d-replay { border-radius: 0 0 12px 12px; }
  .d-rail { position: sticky; z-index: 5; top: calc(var(--bar-h, 64px) + 46px); align-self: start; max-height: calc(100svh - var(--bar-h, 64px) - 46px); }
  .d-drawer { position: fixed; top: var(--bar-h, 64px); bottom: 0; right: 0; z-index: 30; }
  .d-drawer:not(:has(> .d-demobar))::before { display: block; }
  .d-toasts { position: sticky; left: auto; right: auto; bottom: 16px; width: min(360px, 90%); height: 0; margin: 0 16px 0 auto; max-width: none; justify-content: flex-end; z-index: 31; }
  .d-pal { max-height: calc(100svh - var(--bar-h, 64px) - 24px); }
}
.desk .d-toast:nth-last-child(n+3) { display: none; }
.d-drawer > div:last-child { overscroll-behavior: contain; }

/* sheets on a phone, with the label inside them */
.d-back { display: none; }
.d-pop__t { padding: 10px 12px 4px; font-size: 12px; font-weight: 600; color: var(--d-mute); }
.d-pop__t--phone { display: none; }
.d-pop__row { align-items: center; text-align: left; }
.d-pop__row:not([data-act]) { cursor: default; }
@media (max-width: 760px) {
  .desk .d-toast:not(:last-child) { display: none; }
  .d-back { display: block; position: fixed; inset: 0; z-index: 39; background: rgba(0, 0, 0, .35); }
  .desk .d-pop { position: fixed !important; left: 0 !important; right: 0 !important; top: auto !important; bottom: 0; width: auto !important; max-height: 72svh; z-index: 40; border-radius: 14px 14px 0 0; border-width: 1px 0 0; padding-bottom: env(safe-area-inset-bottom, 0px); overscroll-behavior: contain; }
  .d-pop__t--phone { display: block; color: var(--d-ink); background: var(--d-sunk); padding: 6px 12px; border-bottom: 1px solid var(--d-line); }
  .desk .d-pop__row { min-height: 52px; }
  .d-pal { max-height: calc(100svh - 24px); }
  .desk .d-pal__row { min-height: 48px; height: auto; }
  .d-scrim { overscroll-behavior: contain; }
}

/* search on a tablet's desk covers the top bar, so it brings the label with it */
@media (pointer: coarse) and (min-width: 761px), (pointer: fine) and (min-width: 761px) and (max-width: 1040px) {
  .d-pal .d-pop__t--phone { display: block; color: var(--d-ink); background: var(--d-sunk); padding: 6px 12px; border-bottom: 1px solid var(--d-line); }
}

/* with JavaScript off, a desk that runs edge to edge on a phone leaves its one line against the glass */
@media (max-width: 760px) { #desk noscript p { padding-inline: var(--gut, 20px); } }

/* the search label says what it searches where there's room, and "Search" where there isn't */
.d-search .s-short { display: none; }
@container desk (max-width: 340px) { .d-search .s-long { display: none; } .d-search .s-short { display: inline; } }
/* search's rows live in .d-layer, outside the desk's container, so this one goes by the screen */
@media (max-width: 340px) { .d-pal__row .trunc { white-space: normal; } }

/* the tab bar */
.d-nav--tab, .d-short { display: none; }
@container desk (max-width: 620px) {
  .d-nav--tab { display: flex; position: relative; }
  .d-long { display: none; } .d-short { display: inline; }
  .d-nav__n--hot { right: calc(50% - 24px); top: 3px; }
  .d-head { gap: 4px 10px; padding: 8px 12px; }
  .d-head__r { margin-left: auto; width: auto; }
  .d-head__sub { order: 3; width: 100%; white-space: normal; }
  .d-sec { padding: 12px; }
  /* every view on show, nothing hiding off the right edge */
  .d-views { flex-wrap: wrap; overflow: visible; padding: 0 4px; }
  .d-views--stages { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 0; }
  .d-views--stages .d-view { display: flex; flex-direction: column; align-items: center; justify-content: center; height: 54px; padding: 0 2px; line-height: 1.2; }
  .d-views--stages .d-view em { margin-left: 0; }
}

/* one type scale for the desk: 10 for avatars and the smallest badges, 12 for labels, 13 for rows, 16 for the screen's name, 20 for a number */
.desk .av, .desk .d-dot, .desk .d-nav__n--hot { font-size: 10px; }
.desk .d-chip, .desk .d-demo, .desk .d-search kbd, .desk .d-table th, .desk .d-view em, .desk .d-stat span, .desk .d-nav__n:not(.d-nav__n--hot), .desk .d-rail__h, .desk .d-sec__h h4, .desk .d-sec__h .mute, .desk .d-replay, .desk .d-demobar { font-size: 12px; }
.desk h3 { font-size: 16px; }
.desk .d-stat b { font-size: 20px; }

/* pressed, focused, and nothing stuck hovered under a finger */
.desk button:not(:disabled):active { filter: brightness(.94); }
.desk button:disabled { cursor: default; }
.desk .d-top :focus-visible { outline-color: var(--d-top-ink); }
.desk h3[tabindex]:focus { outline: none; }
@media (hover: none) {
  .d-search kbd { display: none; }
  .desk .d-nav:not(.is-on):hover, .desk .d-pop__row:hover, .desk .d-pal__row:hover, .desk .d-top__ws:hover, .desk .d-icbtn:hover, .desk .d-me:hover { background: none; }
  .desk .d-btn:not(.d-btn--pri):hover { background: var(--d-raised); }
  .desk .d-table tbody tr:hover td { background: none; }
  .desk .d-table tr.is-sel:hover td { background: var(--d-accent-soft); }
  .desk .d-link:hover { text-decoration: none; }
}

/* on a framed desk a short list shares its pane: rows take what's spare, instead of leaving it all under the last one */
.fill-col { display: flex; flex-direction: column; }
.fill-col > .d-table { flex: 1 1 auto; }
.fill-col > .summ, .fill-col > .d-sec { flex: none; }

/* rows */
.t-open { font-weight: 600; }
@media (hover: hover) { .t-open:hover { text-decoration: underline; text-underline-offset: 2px; } }
.p-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 2px 10px; padding: 10px 12px; border-bottom: 1px solid var(--d-line); align-items: center; }
.p-row .d-chip { justify-self: end; }
.row-act { justify-self: end; text-align: right; }
.desk .d-scroll { scrollbar-width: thin; }
@container desk (max-width: 820px) {
  .d-split { grid-template-columns: minmax(0, 1fr) !important; }
  .d-split > * { border-right: 0 !important; }
}
@container desk (max-width: 900px) { .d-me .nw { display: none; } .desk .d-me { padding-right: 3px; } }
