/* ==========================================================================
   TrueFlo desk windows (site v7, lane B)
   Drawn, static console windows, one per desk: the desk's board with the
   active sidebar item, a short list with STOP / Caught / Clean badges, and
   the one item that needs a person opened. Load console-demo.css first: this
   file reuses its window, sidebar, card, badge, button and type classes and
   adds the board (dw-*) on top. No JS.

   Root: <div class="cdemo cdemo--desk" data-desk="shipping|order|finance">
   Compact variant: add cdemo--compact (no sidebar, the opened item expands
   inside the list). Made for 520 to 640px, holds from 360 to 720.

   Layout by the window's own width, as the demo does:
     760 and up   list on the left, the opened item in a panel on the right
     under 760    one column, the opened item expands under its row
     (sidebar: 200px from 940, icon rail 760 to 939, chips under 700)
   Rows fade in as they scroll into view where the browser supports
   scroll-driven animation. Reduced motion: no fade, everything shown.
   ========================================================================== */

.cdemo--desk{
  --cd-stop:var(--stop,#c42b2b);
  --cd-stop-bg:var(--stop-bg,#fbe9e9);
}
.cdemo--desk .cd-window{min-height:0}
.cd-t-stop{background:var(--cd-stop-bg);color:var(--cd-stop)}
.cd-t-stop .cd-dot{background:var(--cd-stop)}
.cdemo--desk .dw-i{display:block;flex:none;fill:none;stroke:currentColor;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round}
.cdemo--desk .cd-nico .dw-i{width:14px;height:14px;stroke-width:2}
.cdemo--desk .cd-ico .dw-i{width:14px;height:14px;stroke-width:2}

/* ---------------------------------------------------------------- header */
.dw-main{gap:16px}
.dw-head{display:flex;align-items:flex-end;justify-content:space-between;gap:8px 24px;flex-wrap:wrap}
.dw-title{font-size:20px;line-height:28px;font-weight:600;letter-spacing:-.015em;color:var(--cd-ink)}
/* the strap under the title: a time on the left, the counts on the right, both plain 13px muted */
.dw-head > div{flex:1;min-width:0}
.dw-strip{display:flex;flex-wrap:wrap;align-items:baseline;justify-content:space-between;gap:4px 16px;margin-top:4px;font-size:13px;line-height:18px;color:var(--cd-muted)}

/* ---------------------------------------------------------------- body */
.dw-body{display:grid;grid-template-columns:minmax(0,1.45fr) minmax(0,1fr);gap:16px;align-items:stretch}
.dw-board{display:flex;flex-direction:column}
/* a row is the demo's document row: status, a plain title over one short muted line, the reference in a quiet mono column, the chevron */
.dw-colhead,.dw-row{display:grid;grid-template-columns:84px minmax(0,1fr) 68px 16px;column-gap:12px;align-items:center;padding:0 16px}
.dw-colhead{min-height:32px;border-bottom:1px solid var(--cd-line);background:var(--cd-tint);font:600 12px/16px var(--cd-sans);letter-spacing:.05em;text-transform:uppercase;color:var(--cd-muted)}
.dw-row{min-height:60px;padding-top:8px;padding-bottom:8px;border-top:1px solid var(--cd-line)}
.dw-colhead + .dw-row{border-top:0}
.dw-row > .cd-badge{justify-self:start}
.dw-txt{min-width:0}
.dw-ref{font:500 12.5px/18px var(--cd-mono);letter-spacing:0;color:var(--cd-muted);white-space:nowrap;text-align:right}
.dw-chev{width:16px;height:16px;color:var(--cd-muted)}
.dw-row.dw-r-attn{box-shadow:inset 3px 0 0 var(--cd-attn-dot)}
.dw-row.dw-r-stop{box-shadow:inset 3px 0 0 var(--cd-stop)}
.dw-row.is-open{background:var(--cd-inset)}
.dw-row.is-open .dw-chev{color:var(--cd-ink)}
.dw-more{display:flex;align-items:center;min-height:40px;padding:8px 16px 8px 112px;border-top:1px solid var(--cd-line);font-size:13px;line-height:18px;color:var(--cd-muted)}
.dw-sep{display:flex;align-items:center;min-height:32px;padding:0 16px;border-top:1px solid var(--cd-line);background:var(--cd-tint);font:600 12px/16px var(--cd-sans);letter-spacing:.05em;text-transform:uppercase;color:var(--cd-muted)}
.dw-foot{display:flex;align-items:center;justify-content:space-between;flex-wrap:wrap;gap:4px 12px;min-height:44px;margin-top:auto;padding:12px 16px;border-top:1px solid var(--cd-line);font-size:13px;line-height:18px;color:var(--cd-muted)}
.dw-foot b{font-weight:600;color:var(--cd-ink)}

/* the opened item, inline under its row (compact and narrow) */
.dw-expand{display:none;flex-direction:column;gap:12px;padding:12px 16px 16px;border-top:1px solid var(--cd-line);background:var(--cd-inset)}
.dw-expand.dw-r-attn{box-shadow:inset 3px 0 0 var(--cd-attn-dot)}
.dw-expand.dw-r-stop{box-shadow:inset 3px 0 0 var(--cd-stop)}

/* the opened item, in a panel on the right */
.dw-detail{display:flex;flex-direction:column;gap:12px;padding:16px 20px 16px;border:1px solid var(--cd-line);border-radius:12px;background:var(--cd-surface);min-width:0}
.dw-d-top{display:flex;align-items:flex-start;justify-content:space-between;gap:12px}
.dw-d-idrow{display:flex;align-items:center;flex-wrap:wrap;gap:4px 12px;margin-top:4px}
.dw-d-id{font-family:var(--cd-mono);font-size:18px;line-height:26px;font-weight:600;letter-spacing:-.01em;color:var(--cd-ink)}
.dw-d-sub{margin-top:4px;font-size:13px;line-height:18px;color:var(--cd-ink-2)}
.dw-d-amt{flex:none;text-align:right}
.dw-d-amt .cd-num{display:block;margin-top:4px;font-size:18px;line-height:26px;font-weight:600;color:var(--cd-attn)}

/* two quantities side by side */
.dw-qty{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px}
.dw-qbox{display:flex;flex-direction:column;gap:4px;padding:12px 16px;border:1px solid var(--cd-line);border-radius:10px;background:var(--cd-surface);min-width:0}
.dw-qbox .cd-label{font:500 13px/18px var(--cd-sans);letter-spacing:0;text-transform:none}
/* a mismatch: the box stays plain, the value gets a small mark */
.dw-qbox .cd-num{display:inline-block;margin:0 2px 0 -6px;padding:1px 6px;border-radius:4px;background:var(--cd-attn-bg);font-size:20px;line-height:28px;font-weight:600;color:var(--cd-attn)}
.dw-qbox .dw-q-u{font-size:13px;line-height:18px;color:var(--cd-muted)}
.dw-qbox .dw-q-s{font-size:12px;line-height:16px;color:var(--cd-muted)}

/* a quoted line from a document */
.dw-quote{display:flex;flex-direction:column;gap:4px;padding:12px 16px;border:1px solid var(--cd-line);border-radius:10px;background:var(--cd-inset)}
.dw-quote .cd-num{font-size:13px;line-height:18px;color:var(--cd-ink);white-space:normal}

/* a short list of lines or evidence */
.dw-list{display:flex;flex-direction:column;border:1px solid var(--cd-line);border-radius:10px;background:var(--cd-surface)}
.dw-list-h{display:flex;align-items:center;justify-content:space-between;gap:12px;min-height:36px;padding:8px 16px 4px}
.dw-li{display:flex;align-items:center;justify-content:space-between;gap:12px;min-height:36px;padding:8px 16px;border-top:1px solid var(--cd-line);font-size:13px;line-height:18px;color:var(--cd-ink-2)}
.dw-list-h + .dw-li{border-top:0}
.dw-li .cd-num{font-size:13px;color:var(--cd-ink)}
.dw-li--total{font-weight:600;color:var(--cd-ink)}
.dw-ev{justify-content:flex-start;gap:8px}
.dw-ev .dw-i{width:14px;height:14px;stroke-width:2.4}
.dw-ev-ok .dw-i{color:var(--cd-ok)}
.dw-ev-no .dw-i{color:var(--cd-muted)}

/* the prepared fix */
.dw-fix{display:flex;flex-direction:column;gap:4px;padding:12px 16px 16px;border:1px solid var(--cd-line-strong);border-radius:12px;background:var(--cd-inset)}
.dw-fix-top{display:flex;align-items:center;justify-content:space-between;gap:8px;min-height:24px}
.dw-fix-t{margin-top:4px;font-size:14px;line-height:20px;font-weight:600;color:var(--cd-ink)}
.dw-fix-s{font-size:13px;line-height:18px;color:var(--cd-ink-2)}
.dw-fix-s .cd-num{font-size:12px;color:var(--cd-ink)}
.dw-fix .cd-draft-act{margin-top:12px}
.dw-ok-chip{display:inline-flex;align-items:center;gap:6px;align-self:flex-start;height:24px;padding:0 8px;border-radius:6px;background:var(--cd-ok-bg);font-size:12px;line-height:16px;font-weight:500;color:var(--cd-ok)}
.dw-ok-chip .dw-i{width:12px;height:12px;stroke-width:2.6}
.dw-detail .cd-note{margin-top:auto}

/* ==================================================================== sizes */
/* The board needs about 545px for a row's line to stay on one line beside the opened item, so a desk
   window folds its sidebar to the icon rail below 1200px, as the console itself does. */
@container cdemo (min-width: 760px) and (max-width: 1199px){
  .cdemo--desk .cd-side{width:60px;align-items:center;padding:12px 8px}
  .cdemo--desk .cd-brand{justify-content:center;padding:0;width:40px}
  .cdemo--desk .cd-word,.cdemo--desk .cd-nlabel,.cdemo--desk .cd-kbd{display:none}
  .cdemo--desk .cd-group{width:20px;height:1px;margin:10px auto;padding:0;font-size:0;line-height:0;background:var(--cd-line-strong)}
  .cdemo--desk .cd-nav{justify-content:center;width:40px;padding:0}
  .cdemo--desk .cd-nav--search{margin-bottom:0}
  .cdemo--desk .cd-nav + .cd-nav{margin-top:6px}
  .cdemo--desk .cd-side .cd-pill{position:absolute;top:-3px;right:-4px;min-width:18px;height:18px;padding:0 5px;box-shadow:0 0 0 2px var(--cd-side)}
}
@container cdemo (min-width: 1140px){
  .cdemo--desk .cd-main{padding:20px 24px}
  .dw-body{gap:20px}
}
@container cdemo (max-width: 759px){
  .cdemo--desk .cd-main{padding:12px}
  .dw-main{gap:12px}
  .dw-body{grid-template-columns:minmax(0,1fr)}
  .dw-detail{display:none}
  .dw-expand{display:flex}
  .dw-title{font-size:18px;line-height:26px}
}
@container cdemo (max-width: 459px){
  .dw-strip{justify-content:flex-start}
  .dw-colhead{display:none}
  .dw-row{grid-template-columns:minmax(0,1fr) auto 16px;grid-template-areas:"badge ref chev" "txt txt chev";row-gap:6px;padding:12px}
  .dw-row > .cd-badge{grid-area:badge}
  .dw-row > .dw-txt{grid-area:txt}
  .dw-row > .dw-ref{grid-area:ref}
  .dw-row > .dw-chev{grid-area:chev}
  .dw-expand,.dw-sep,.dw-foot,.dw-more{padding-left:12px;padding-right:12px}
  .dw-qty{gap:8px}
  .dw-qbox{padding:12px}
}

/* compact: for beside a capability row. No sidebar, the opened item inline. */
.cdemo--compact .cd-side{display:none}
.cdemo--compact .cd-main{padding:12px}
.cdemo--compact .dw-main{gap:12px}
.cdemo--compact .dw-body{grid-template-columns:minmax(0,1fr)}
.cdemo--compact .dw-detail{display:none}
.cdemo--compact .dw-expand{display:flex}
.cdemo--compact .dw-title{font-size:16px;line-height:24px}
.cdemo--compact .dw-foot{display:none}
.cdemo--compact .dw-full{display:none}
@container cdemo (min-width: 520px){
  .cdemo--compact .cd-main{padding:16px}
}

/* ==================================================================== reveal */
@media (prefers-reduced-motion: no-preference){
  @supports (animation-timeline: view()){
    .cdemo--desk .dw-row,.cdemo--desk .dw-sep{animation:dw-in linear both;animation-timeline:view();animation-range:entry 0% entry 100%}
    .cdemo--desk .dw-detail,.cdemo--desk .dw-expand{animation:dw-in linear both;animation-timeline:view();animation-range:entry 0% entry 30%}
  }
}
@keyframes dw-in{from{opacity:0;translate:0 10px}to{opacity:1;translate:0 0}}
