/* ============================================================================
   UI STEP 6 (2026-10-12) — the work panel, Board, Files, a teammate's computer
   and the Shop page: today-panel.js, computer-view.js, shop-view.js.
   ----------------------------------------------------------------------------
   After hire.css and composer-menus.css, so it wins at equal specificity over
   style.css's step-2 panel rules it builds on. Every duration and curve is a
   token (style.css, step 1's motion pack): fast and light, exits at 0.7, and
   under reduced motion every move is an 80ms fade. Nothing that shows money
   moves with a spring.
   ============================================================================ */

/* ---------- the work panel: Jobs ------------------------------------------- */
.tdp-head { padding: 6px 6px 10px; }
.tdp-h { margin: 0; font-size: 17px; font-weight: 600; letter-spacing: -0.01em; }
.tdp-sub { margin: 3px 0 0; font-size: 12.5px; color: var(--dim); }
.tdp-group { margin-top: 4px; }
.tdp-group + .tdp-group { margin-top: 10px; }
.tdp-group-head {
  display: flex; align-items: baseline; gap: 8px; margin: 0 0 2px; padding: 7px 10px;
  border-radius: 8px; background: var(--card-2); font-size: 13px; font-weight: 600;
}
.tdp-group[data-group="needs"] .tdp-group-head { background: var(--honey-tint); }
.tdp-group-head .tdp-col-count { font-weight: 500; }
.tdp-jobrow { display: flex; align-items: center; gap: 4px; }
.tdp-jobrow .tdp-open { flex: 1; min-width: 0; }
.tdp-open.tdp-job, .tdp-open.tdp-file {
  grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; column-gap: 10px;
}
.tdp-main { display: grid; gap: 2px; min-width: 0; }
.tdp-main .tdp-title { font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tdp-av { width: 26px; height: 26px; border-radius: 7px; font-size: 12px; }
.tdp-when { font: 500 12px/1.2 var(--f-body); letter-spacing: normal; color: var(--dim); white-space: nowrap; font-variant-numeric: tabular-nums; }
.tdp-watch { flex: none; }
/* Watch at phone width too, since UI step 8: there the Computer opens in the
   Ask sheet (workbench.js `openComputer`). It was hidden here while the
   workbench had no Computer to open at that width and the button did nothing. */
.tdp-show { margin: 4px 0 0 42px; font-size: 12.5px; color: var(--dim); }
.tdp-person { grid-template-columns: auto minmax(0, 1fr); align-items: center; column-gap: 10px; }

/* ---------- Board ------------------------------------------------------------ */
.tdp-board-bar { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; padding: 2px 4px 10px; }
.tdp-board-bar .tdp-sub { margin: 0; }
.tdp-col[data-col="needs"] { background: var(--honey-tint); }
.tdp-cardbtn { gap: 6px; padding: 10px 10px 9px; }
.tdp-cardbtn .tdp-title { font-weight: 500; }
.tdp-owner { display: flex; align-items: center; gap: 7px; min-width: 0; font-size: 12.5px; color: var(--text); }
.tdp-owner .tdp-av { width: 20px; height: 20px; border-radius: 6px; font-size: 10.5px; }
.tdp-owner-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tdp-owner .tdp-when { margin-left: auto; }

/* ---------- Files ------------------------------------------------------------ */
.tdp-search {
  width: 100%; box-sizing: border-box; min-height: 36px; margin: 2px 0 8px; padding: 0 12px;
  border: 1px solid var(--line); border-radius: 10px; background: var(--card); color: var(--text); font: inherit; font-size: var(--t-sm);
}
.tdp-search:focus-visible { outline: 2px solid var(--focus-ring); outline-offset: 1px; }
.tdp-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 6px; }
.tdp-chip {
  min-height: 30px; padding: 0 11px; border-radius: 999px; border: 1px solid var(--line); background: var(--card);
  font: inherit; font-size: 12.5px; color: var(--text); cursor: pointer;
  transition: background var(--dur-instant) var(--ease-snap), color var(--dur-instant) var(--ease-snap);
}
.tdp-chip[aria-pressed="true"] { background: var(--text); border-color: var(--text); color: var(--card); }
.tdp-chip:focus-visible { outline: 2px solid var(--focus-ring); outline-offset: 2px; }
.tdp-fsec + .tdp-fsec { margin-top: 8px; }
.tdp-fsec-head { background: none; padding: 8px 6px 4px; color: var(--dim); font-weight: 500; font-size: 12.5px; }
.tdp-ficon {
  display: inline-grid; place-items: center; width: 30px; height: 30px; border-radius: 8px; flex: none;
  font: 600 9.5px/1 var(--f-body); letter-spacing: .02em; color: #fff; background: var(--fill-graphite, #6B645C);
}
.tdp-ficon[data-kind="docs"] { background: var(--fill-denim, #2F6690); }
.tdp-ficon[data-kind="data"] { background: var(--fill-sage, #5B7043); }
.tdp-ficon[data-kind="images"] { background: var(--fill-honey, #855614); }

/* Lists arrive: 18ms apart, the first six only, and only when a tab is chosen
   — a redraw of the same tab (the store's fifteen-second read) does not
   replay it (`tdp-swap` is added on a tab change alone). */
.tdp-body.tdp-swap .tdp-row { animation: td-rise var(--dur-base) var(--ease-snap) both; animation-delay: calc(var(--i, 0) * 18ms); }

/* ---------- a teammate's computer (workbench.js Computer tab) --------------- */
.wbc-live { display: flex; flex-direction: column; gap: 12px; padding: 14px 16px 18px; }
.wbc-who { display: flex; flex-wrap: wrap; gap: 6px; }
.wbc-chip {
  display: inline-flex; align-items: center; gap: 7px; min-height: 32px; padding: 0 12px 0 5px; border-radius: 999px;
  border: 1px solid var(--line); background: var(--card); font: inherit; font-size: 13px; color: var(--text); cursor: pointer;
  transition: background var(--dur-instant) var(--ease-snap);
}
.wbc-chip[aria-pressed="true"] { background: var(--card-2); border-color: var(--line-2, var(--edge-2)); font-weight: 600; }
.wbc-chip .wbc-av { width: 22px; height: 22px; border-radius: 999px; font-size: 11px; }
.wbc-head { display: flex; align-items: center; gap: 10px; }
.wbc-av { width: 32px; height: 32px; border-radius: 9px; font-size: 14px; }
.wbc-words { display: grid; gap: 1px; min-width: 0; flex: 1; }
.wbc-name { font-size: 15px; }
.wbc-job { font-size: 12.5px; color: var(--dim); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wbc-honest { margin: 0; font-size: 12.5px; color: var(--dim); }
.wbc-now { margin: 0; display: flex; align-items: baseline; flex-wrap: wrap; gap: 4px; padding: 10px 12px; border-radius: var(--card-r-in); background: var(--card-2); font-size: var(--t-sm); }
.wbc-now .wbc-clock { margin-left: auto; font: 500 12px/1 var(--f-body); letter-spacing: normal; color: var(--dim); font-variant-numeric: tabular-nums; }
.wbc-url, .wbc-query { font-family: var(--f-mono); font-size: 12.5px; overflow-wrap: anywhere; }
.wbc-h { margin: 4px 0 6px; font-size: 13px; font-weight: 600; }
.wbc-steps { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.wbc-step {
  display: grid; grid-template-columns: 24px minmax(0, 1fr) auto; align-items: center; gap: 10px; padding: 8px 10px;
  border: 1px solid var(--line); border-radius: var(--card-r-in); background: var(--card);
}
.wbc-step[data-state="open"] { border-color: var(--fill-sage, #5B7043); box-shadow: 0 0 0 1px var(--fill-sage, #5B7043); }
.wbc-n { display: grid; place-items: center; width: 24px; height: 24px; border-radius: 7px; background: var(--card-2); font: 600 12px/1 var(--f-body); font-variant-numeric: tabular-nums; }
.wbc-step-words { display: grid; gap: 1px; min-width: 0; font-size: 13px; }
.wbc-verb { color: var(--dim); font-size: 12px; }
.wbc-step-state { font: 500 12px/1 var(--f-body); letter-spacing: normal; color: var(--dim); }
.wbc-step[data-state="open"] .wbc-step-state { color: var(--sage, #5B7043); }
.wbc-step[data-state="failed"] .wbc-step-state { color: var(--wine); }
.wbc-none { margin: 0; color: var(--dim); font-size: var(--t-sm); }
.wbc-actions { margin-top: 2px; }

/* ---------- the Shop page (shop-view.js) ------------------------------------ */
/* Laid out the way Today is — its own scroll, the composer sticky at the foot
   of the head's column — so arriving here from Today moves nothing that was
   already in place: the rail, the top bar and the chat panel keep their
   tracks, and only the page's own content changes. */
#shop-view { display: none; }
#app.view-shop #shop-view { display: flex; }
#app.view-shop { --vh: var(--fill-sage); --vw: var(--sage-wash, var(--card-2)); --vi: var(--sage, var(--text)); }
#shop-view {
  flex: 1; min-height: 0; overflow-y: auto; flex-direction: column; padding: 80px 32px 32px;
  background: linear-gradient(to bottom, color-mix(in srgb, var(--sage-wash, var(--card-2)) 70%, var(--window)) 0, var(--window) 300px) local;
}
.shop-inner {
  width: min(1120px, 100%); margin: 0 auto; display: grid; grid-template-columns: minmax(0, 1fr) minmax(260px, 320px);
  gap: 32px; align-items: start;
}
@container page (max-width: 900px) { .shop-inner { grid-template-columns: minmax(0, 1fr); gap: 20px; } }
.shop-main { display: flex; flex-direction: column; gap: 18px; min-width: 0; }
.shop-head { display: flex; align-items: center; gap: 14px; }
.shop-mark {
  display: grid; place-items: center; width: 44px; height: 44px; flex: none; border-radius: 11px;
  background: var(--wine); color: #fff; font-size: 18px; font-weight: 600;
}
.shop-head-words { display: grid; gap: 2px; min-width: 0; }
#shop-h { margin: 0; font-size: clamp(24px, 4cqi, 28px); font-weight: 600; letter-spacing: -.02em; line-height: 1.15; overflow-wrap: anywhere; }
.shop-facts { margin: 0; font-size: 13.5px; color: var(--dim); }
/* The composer, in the Shop's column rather than at the window's foot: the
   canvas puts "New chat in <shop>" under the head. Not sticky — the lists
   below are what scrolls past it, and a box riding over them hides rows. */
#shop-composer-slot:empty { display: none; }
#shop-composer-slot > * { margin: 0; }
.shop-tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--line); }
.shop-tab {
  background: none; border: 0; border-bottom: 2px solid transparent; margin-bottom: -1px; min-height: 40px; padding: 0 12px;
  font: inherit; font-size: var(--t-sm); color: var(--dim); cursor: pointer;
  transition: color var(--dur-quick) var(--ease-snap), border-color var(--dur-quick) var(--ease-snap);
}
.shop-tab:hover { color: var(--text); }
.shop-tab[aria-selected="true"] { color: var(--text); border-bottom-color: var(--vh, var(--text)); font-weight: 600; }
.shop-tab:focus-visible { outline: 2px solid var(--focus-ring); outline-offset: -2px; border-radius: 6px; }
.shop-body { min-height: 160px; }
/* One column (the chat open beside the page): an empty tab's one line is not
   held 160px tall, which left a ~150px hole between it and About you. */
@container page (max-width: 900px) { .shop-body:has(.shop-empty) { min-height: 0; } }
.shop-list { list-style: none; margin: 0; padding: 0; }
.shop-row { border-top: 1px solid var(--line); }
.shop-row:first-child { border-top: 0; }
.shop-open {
  display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; column-gap: 12px; width: 100%;
  padding: 11px 8px; border: 0; background: none; border-radius: var(--card-r-in);
  font: inherit; color: var(--text); text-align: left; cursor: pointer;
  transition: background var(--dur-instant) var(--ease-snap);
}
.shop-open:has(> .tdp-ficon) { grid-template-columns: auto minmax(0, 1fr) auto; }
.shop-open:hover { background: var(--card-2); }
.shop-open:focus-visible { outline: 2px solid var(--focus-ring); outline-offset: -2px; }
.shop-main { min-width: 0; }
.shop-open .shop-main, .shop-change .shop-main { display: grid; gap: 2px; }
.shop-title { font-size: var(--t-sm); font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.shop-sub { font-size: 12.5px; color: var(--dim); overflow-wrap: anywhere; }
.shop-when { font: 500 12px/1.2 var(--f-body); letter-spacing: normal; color: var(--dim); white-space: nowrap; font-variant-numeric: tabular-nums; }
.shop-change { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; column-gap: 12px; padding: 11px 8px; }
.shop-change .shop-title { white-space: normal; }
.shop-note { margin: 10px 8px 6px; font-size: 12.5px; color: var(--dim); }
.shop-empty { margin: 16px 8px; color: var(--dim); font-size: var(--t-sm); }
.shop-foot { display: flex; justify-content: flex-start; margin-top: 8px; }
.shop-body.shop-swap .shop-row { animation: td-rise var(--dur-base) var(--ease-snap) both; animation-delay: calc(var(--i, 0) * 18ms); }

.shop-side { display: grid; gap: 16px; }
.shop-side-in { display: grid; gap: 16px; }
.shop-card { background: var(--card); border-radius: var(--card-r); box-shadow: var(--elev-1); padding: 14px 16px 16px; }
/* min-height is a small button's: a card whose head has no button (the Space
   card with no Space, or two) keeps the same title-to-body spacing as one
   that has its Open or Edit, instead of its title sitting 4px off the text. */
.shop-card-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 8px; min-height: var(--btn-h-sm); }
.shop-card-h { margin: 0; font-size: var(--t-md); font-weight: 600; }
.shop-card-text { margin: 0; font-size: var(--t-sm); line-height: 1.5; overflow-wrap: anywhere; }
.shop-card-note { margin: 10px 0 0; font-size: 12px; color: var(--dim); }
/* The shop's Space (Spaces slice 5, part 2): a side card's look, in the main
   column above the tabs. One quiet line of what it holds and who touched it
   last, then its newest blocks' words as small pills that wrap — no canvas. */
.shop-main > .shop-card[data-shop-card="space"] { padding: 12px 16px 14px; }
.shop-main > .shop-card[data-shop-card="space"] .shop-card-head { margin-bottom: 4px; }
.shop-space-meta { display: flex; align-items: baseline; gap: 12px; margin: 0; font-size: 12.5px; color: var(--dim); min-width: 0; }
.shop-space-what { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.shop-space-labels { list-style: none; margin: 10px 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.shop-space-label, .shop-space-more {
  max-width: 100%; padding: 3px 9px; border-radius: 999px; font-size: 12.5px; line-height: 1.4;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.shop-space-label { background: var(--card-2); color: var(--text); }
.shop-space-more { color: var(--dim); }
.shop-space-list { margin-top: 6px; }
.shop-space-error { color: var(--err); } /* the error ink (wine): a failure is never brand red */
.shop-tools { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.shop-tool { display: flex; align-items: center; gap: 10px; min-height: 32px; font-size: var(--t-sm); }
.shop-tool svg { flex: none; }
.shop-tool-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.shop-tool-state { font-size: 12px; color: var(--dim); }
.shop-tool-state[data-tone="warn"] { color: var(--honey, var(--text)); font-weight: 500; }
.shop-spend { margin: 0; display: grid; gap: 0; }
.shop-spend-row { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; padding: 7px 0; border-top: 1px solid var(--line); }
.shop-spend-row:first-child { border-top: 0; }
.shop-spend dt { font-size: var(--t-sm); color: var(--dim); min-width: 0; }
.shop-spend dt { flex: 1 1 auto; }
.shop-spend dd { margin: 0; flex: 0 1 auto; white-space: nowrap; font-size: var(--t-sm); font-weight: 500; text-align: right; font-variant-numeric: tabular-nums; }

@media (max-width: 720px) {
  #shop-view { padding: 16px 16px 24px; }
  .shop-inner { grid-template-columns: minmax(0, 1fr); gap: 20px; }
  .shop-head { gap: 12px; }
  .shop-mark { width: 38px; height: 38px; font-size: 16px; border-radius: 10px; }
  .shop-tabs { overflow-x: auto; scrollbar-width: none; }
  .shop-tab { flex: none; min-height: 44px; }
}

@media (prefers-reduced-motion: reduce) {
  .tdp-body.tdp-swap .tdp-row, .shop-body.shop-swap .shop-row { animation: td-fade 80ms linear both; animation-delay: 0s; }
  .tdp-chip, .wbc-chip, .shop-tab, .shop-open { transition: none; }
}
