/* The home page's workspace (static/p-workspace.js, docs/proposals.md surface `home`). Loaded by the home page only
   (build/site_pages.py HOME_CSS); colours are site.css's tokens, so light and dark follow the site's themes.
   WHY calm (Zach's UI rules): one answer line first, sections as wide as the column (no cards of three heights), photos
   big enough to tell parts apart, every name whole. */

/* the main column's section headings: Your workspace, Browse all parts (small caps, as McMaster's section rules) */
.groups .ws-h { margin: 6px 0 10px; padding-bottom: 6px; border-bottom: 1px solid var(--rule2); font-size: 12.5px; font-weight: 650;
  text-transform: uppercase; letter-spacing: .06em; color: var(--ink2); }
.groups .ws-browse { margin-top: 30px; }
.ws { margin-bottom: 4px; }
.ws-hint { margin: 0 0 14px; padding: 8px 12px; border: 1px solid var(--rule2); border-left: 3px solid var(--accent); border-radius: 4px; color: var(--ink2); }
.ws-hint[hidden] { display: none; }
.ws-reading { margin: 0; }

/* the answer line: what is yours, each count a link to it */
.ws-answer:empty { display: none; }
.ws-sum { margin: 0 0 16px; font-size: 15.5px; color: var(--ink2); overflow-wrap: anywhere; }
.ws-sum a { color: var(--ink); white-space: nowrap; }
.ws-sum a b { font-weight: 700; }
.ws-sum a:hover { color: var(--accent); text-decoration: none; }
.ws-dot { color: var(--ink3); }

/* a section: its heading with the count, then its body */
.ws-sec { margin: 0 0 22px; min-width: 0; }
.ws-ch { margin: 0 0 8px; font-size: 16px; font-weight: 650; }
.ws-ch a { color: var(--ink); }
.ws-ch a:hover { color: var(--accent); }
.ws-ch .n, .ws-lt .n { font-weight: 500; color: var(--ink2); }
.ws-lt { margin: 0 0 6px; font-size: 14px; font-weight: 600; overflow-wrap: anywhere; }
.ws-lt a { color: var(--ink); }
.ws-note { margin: -4px 0 10px; font-size: 12.5px; color: var(--ink2); }
.ws-empty { margin: 2px 0 0; font-size: 13px; color: var(--ink2); }
.ws-more { margin-top: 8px; }
.ws-more > summary { cursor: pointer; color: var(--accent); font-weight: 600; font-size: 13px; }
.ws-more > .ws-grid { margin-top: 10px; }

/* a photo on its white plate; a part with none says so in words */
.ws-ph { display: flex; align-items: center; justify-content: center; height: 112px; border-radius: 4px; overflow: hidden; }
.ws-ph.plate { padding: 6px; box-shadow: inset 0 0 0 1px var(--rule2); }
.ws-ph img { width: 100%; height: 100%; object-fit: contain; }
.ws-noph { background: var(--bg2); color: var(--ink3); font-size: 12px; box-shadow: inset 0 0 0 1px var(--rule2); }
.ws-ph.ws-sm { height: 76px; }
.ws-ph.ws-xs { width: 46px; height: 46px; padding: 3px; font-size: 9.5px; text-align: center; line-height: 1.1; }

/* photo cards: the whole name under the photo (wraps; past four lines an ellipsis, the whole name in the title) */
.ws-grid { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(9.5rem, 1fr)); gap: 14px 12px; }
.ws-grid-s { grid-template-columns: repeat(auto-fill, minmax(8rem, 1fr)); gap: 12px 10px; }
.ws-pc { display: flex; flex-direction: column; gap: 5px; min-width: 0; color: var(--ink); font-size: 13px; line-height: 1.3; }
.ws-pc:hover { text-decoration: none; }
.ws-pc:hover .ws-nm { color: var(--accent); }
.ws-pc:hover .ws-ph { box-shadow: inset 0 0 0 1px var(--accent); }
.ws-nm { display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden; overflow-wrap: anywhere; font-weight: 500; }
.ws-cat { color: var(--ink2); font-size: 12px; overflow-wrap: anywhere; }

/* lists: each its own row of cards */
.ws-list { margin: 0 0 14px; }
.ws-list:last-child { margin-bottom: 0; }

/* Recently viewed: one row that scrolls inside itself, never the page */
.ws-strip { list-style: none; margin: 0; padding: 0 0 6px; display: grid; grid-auto-flow: column; grid-auto-columns: 7.5rem; gap: 12px; overflow-x: auto; }
.ws-strip .ws-nm { -webkit-line-clamp: 3; font-size: 12.5px; }

/* 1's folds at the end: Builds and Reports, one click away */
.ws-folds { border-top: 1px solid var(--rule2); }
.ws-fold { border-bottom: 1px solid var(--rule2); padding: 8px 0; }
.ws-fold > summary { cursor: pointer; list-style: none; display: flex; align-items: baseline; gap: 6px; }
.ws-fold > summary::-webkit-details-marker { display: none; }
.ws-fold > summary::before { content: "▸"; color: var(--ink2); font-size: 11px; width: 1em; flex: none; }
.ws-fold[open] > summary::before { content: "▾"; }
.ws-fold > summary .ws-ch { margin: 0; font-size: 15px; }
.ws-fold > .ws-note { margin: 6px 0 6px 1.4em; }
.ws-fold > ul, .ws-fold > .ws-more, .ws-fold > .ws-empty { margin-left: 1.4em; }

/* a build in one row: name, readiness, parts */
.ws-brows { list-style: none; margin: 0; padding: 0; }
.ws-brow { padding: 6px 0; border-top: 1px solid var(--rule2); }
.ws-brow:first-child { border-top: 0; }
.ws-brow summary { cursor: pointer; display: grid; grid-template-columns: minmax(0, 1fr) auto auto; gap: 4px 14px; align-items: center; }
.ws-brow .ws-bn { font-weight: 600; overflow-wrap: anywhere; }
.ws-bnames { list-style: none; margin: 6px 0 0; padding: 0; columns: 2 16rem; column-gap: 24px; font-size: 13px; }
.ws-bnames li { padding: 1px 0; break-inside: avoid; overflow-wrap: anywhere; }
.ws-src { margin: 4px 0 0; font-size: 12.5px; color: var(--ink2); overflow-wrap: anywhere; }
.ws-src code, .ws-files code { font-size: 11.5px; background: none; color: var(--ink2); }
.ws-miss { margin: 6px 0 0; font-size: 12.5px; color: var(--ink3); overflow-wrap: anywhere; }

/* readiness: one bar and its percent */
.ws-ready { display: inline-flex; align-items: center; gap: 8px; white-space: nowrap; }
.ws-bar { display: block; width: 120px; height: 8px; border-radius: 4px; background: var(--bg3, var(--bg2)); box-shadow: inset 0 0 0 1px var(--rule2); overflow: hidden; }
.ws-bar > span { display: block; height: 100%; background: var(--accent); border-radius: 4px; }
.ws-pct { font-size: 13px; color: var(--ink2); font-variant-numeric: tabular-nums; min-width: 4.8em; }

/* reports: date, then the title and what it is */
.ws-reports { list-style: none; margin: 0; padding: 0; }
.ws-reports li { display: grid; grid-template-columns: minmax(6.9em, max-content) minmax(0, 1fr); column-gap: 12px; padding: 5px 0; border-top: 1px solid var(--rule2); }
.ws-reports li:first-child { border-top: 0; }
.ws-rt { min-width: 0; display: flex; flex-direction: column; }
.ws-rt a { overflow-wrap: anywhere; }
.ws-date { color: var(--ink2); font-size: 12.5px; white-space: nowrap; font-variant-numeric: tabular-nums; }
.ws-rn { font-size: 12px; color: var(--ink2); overflow-wrap: anywhere; }

/* 2 Builds first: a card per build, as wide as the column */
.ws-bcards { display: grid; grid-template-columns: minmax(0, 1fr); gap: 14px; }
.ws-bcard { padding: 14px 16px; border: 1px solid var(--rule2); border-radius: 6px; min-width: 0; }
.ws-bh { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 6px 16px; }
.ws-bcard .ws-bn { margin: 0; font-size: 17px; font-weight: 650; overflow-wrap: anywhere; min-width: 0; }
.ws-bcard .ws-src { margin: 4px 0 12px; }
.ws-tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(14rem, 1fr)); gap: 12px; }
.ws-tile { padding: 12px 14px; border: 1px solid var(--rule2); border-radius: 6px; min-width: 0; }
.ws-trows { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.ws-more > .ws-trows { margin-top: 6px; }
.ws-tr { display: grid; grid-template-columns: 46px minmax(0, 1fr); gap: 10px; align-items: center; color: var(--ink); font-size: 13px; line-height: 1.3; }
.ws-tr:hover { text-decoration: none; }
.ws-tr:hover .ws-nm { color: var(--accent); }

/* 3 Compact table: tabs over one table */
.ws-tabs { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 10px; }
.ws-tab { display: inline-flex; gap: 6px; align-items: baseline; height: auto; max-width: 100%; padding: 5px 12px; border: 1px solid var(--rule); border-radius: 16px;
  background: var(--bg); color: var(--ink); font: inherit; font-size: 13.5px; cursor: pointer; }
.ws-tab .ws-tl { overflow-wrap: anywhere; min-width: 0; }
.ws-tab:hover { border-color: var(--accent); color: var(--accent); }
.ws-tab[aria-selected="true"] { background: var(--accent-bg); border-color: var(--accent); color: var(--accent); font-weight: 600; }
.ws-tab.ws-zero { color: var(--ink3); border-style: dashed; }
.ws-t { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.ws-t th, .ws-t td { padding: 6px 10px; border-bottom: 1px solid var(--rule2); text-align: left; vertical-align: middle; }
.ws-t th { font-weight: 600; font-size: 12.5px; color: var(--ink2); white-space: nowrap; }
.ws-t .num { text-align: right; }
.ws-t .ws-tph { width: 46px; padding-right: 0; }
.ws-t .ws-tn { min-width: 12rem; font-weight: 500; overflow-wrap: anywhere; }
.ws-t summary { cursor: pointer; font-weight: 600; }
.ws-t .ws-files { font-size: 12px; }

@media (max-width: 767px) {
  .ws-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 10px; }
  .ws-ph { height: 96px; }
  .ws-brow summary { grid-template-columns: minmax(0, 1fr) auto; }
  .ws-brow summary > .n { grid-column: 1; }
  .ws-bar { width: 80px; }
  .ws-t .ws-tn { min-width: 9rem; }
}
