/* PathKEY v5.2 — products. Owner: B-PROD. Colours only from tokens.css.
 * The product as a report cover (components-v5.js productCover), Studio ›
 * Products (library.js: the library, the list, the product editor), the
 * coach's Your products and the Build a product dialog, and a module's
 * sample pages. Studio's .pl-card and .pl-toolbar come from studio.css. */

/* ----------------------------------------------------------- toolbar --- */
.pl-page .pl-card { padding: 0; }
.pl-toolbar .segmented .seg-opt { display: inline-flex; align-items: center; gap: var(--sp-1); }
.pl-chips { display: flex; flex-wrap: wrap; gap: var(--sp-1); }
.pl-chip {
  display: inline-flex; align-items: center; height: 28px; padding: 0 var(--sp-3); border-radius: var(--r-full);
  border: 1px solid var(--line-control); background: var(--bg-surface); color: var(--text-2); font-size: var(--fs-13); cursor: pointer;
  transition: background var(--dur-1) var(--ease), border-color var(--dur-1) var(--ease), color var(--dur-1) var(--ease);
}
.pl-chip.is-on { background: var(--accent-soft); border-color: var(--accent-line); color: var(--accent-text); font-weight: var(--fw-medium); }
.pl-chip:focus-visible { box-shadow: var(--focus-ring); outline: none; }
@media (hover: hover) and (pointer: fine) { .pl-chip:hover { border-color: var(--line-strong); } }
.pl-sort { display: inline-flex; align-items: center; gap: var(--sp-2); margin-left: auto; white-space: nowrap; }
.pl-sort .select { min-width: 140px; }
.pl-body { padding: var(--sp-5); }
.pl-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 248px), 1fr)); gap: var(--sp-6) var(--sp-5); align-items: start; }
.pl-table-wrap { overflow-x: auto; }
.pl-table td { vertical-align: middle; }
.pl-cell-name { display: block; font-weight: var(--fw-medium); }
.pl-open { all: unset; cursor: pointer; color: var(--text); border-radius: var(--r-sm); }
.pl-open:focus-visible { box-shadow: var(--focus-ring); }
@media (hover: hover) and (pointer: fine) { .pl-open:hover { color: var(--text-link); text-decoration: underline; } }

/* ------------------------------------------------- the product cover --- */
.pc { display: flex; flex-direction: column; gap: var(--sp-3); min-width: 0; }
/* Room above and right of the cover for the stack: each sheet behind shows a 15px strip with its module's name. */
.pc-art { position: relative; padding: 45px 18px 0 0; }
.pc-cover { all: unset; position: relative; display: block; width: 100%; box-sizing: border-box; aspect-ratio: 210 / 297; cursor: pointer; border-radius: var(--r-sm); }
.pc-cover.is-static { cursor: default; }
.pc-cover:focus-visible { box-shadow: var(--focus-ring); }
/* The sheets of the stack behind the cover, each labelled with a module. */
.pc-stack { position: absolute; inset: 0; }
.pc-under {
  position: absolute; inset: 0; transform: translate(calc(var(--i) * 6px), calc(var(--i) * -15px));
  border-radius: var(--r-sm); background: var(--bg-surface); border: 1px solid var(--line); box-shadow: var(--shadow-1);
  display: flex; align-items: flex-start; justify-content: flex-start; padding: 1px var(--sp-2);
}
.pc-under-label { font-size: var(--fs-11); line-height: 13px; color: var(--text-muted); max-width: 100%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
/* The cover sheet: the report's cover style, in miniature. */
.pc-sheet {
  position: absolute; inset: 0; display: flex; flex-direction: column; gap: var(--sp-2); padding: 18% 12% 12%;
  border-radius: var(--r-sm); background: var(--paper); border: 1px solid var(--line); box-shadow: var(--shadow-card); overflow: hidden;
  transition: box-shadow var(--dur-2) var(--ease), transform var(--dur-2) var(--ease);
}
.pc-sheet-band { position: absolute; left: 0; right: 0; top: 0; height: 9%; background: var(--teal); }
.pc-sheet-name { font-family: var(--font-display); font-size: var(--fs-16); line-height: 1.2; font-weight: var(--fw-semibold); color: var(--ink); letter-spacing: var(--track-tight);
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.pc-sheet-desc { font-size: var(--fs-12); line-height: 1.35; color: var(--text-2); display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden; }
.pc-sheet-mark { position: absolute; left: 12%; bottom: 8%; width: 28%; height: 3px; border-radius: var(--r-full); background: var(--brass); }
@media (hover: hover) and (pointer: fine) {
  .pc-cover:not(.is-static):hover .pc-sheet { box-shadow: var(--shadow-3); transform: translate(-2px, 2px); }
}
.pc-menu { position: absolute; top: 0; right: 0; z-index: 1; }
.pc-body { display: flex; flex-direction: column; gap: var(--sp-1); min-width: 0; }
.pc-name { font-size: var(--fs-14); line-height: var(--lh-14); font-weight: var(--fw-semibold); }
.pc-desc { font-size: var(--fs-13); color: var(--text-muted); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.pc-mods { font-size: var(--fs-12); color: var(--text-2); }
.pc-facts { display: flex; flex-wrap: wrap; align-items: center; gap: var(--sp-1); font-size: var(--fs-13); color: var(--text-2); }
.pc-fact { display: inline-flex; align-items: center; gap: var(--sp-1); }
.pc-dot { white-space: pre; color: var(--text-muted); }
.pc-facts .icon { color: var(--icon); flex: none; }
.pc-tags { display: flex; flex-wrap: wrap; gap: var(--sp-1); margin-top: var(--sp-1); }
.pc-badge { display: inline-flex; align-items: center; height: 22px; padding: 0 var(--sp-2); border-radius: var(--r-full); font-size: var(--fs-12);
  background: var(--bg-subtle); color: var(--text-2); }
.pc-badge.is-edit { background: var(--accent-soft); color: var(--accent-text); }
.pc-tag { font-size: var(--fs-12); }
.pc-pub { display: flex; flex-direction: column; gap: var(--sp-1); margin-top: var(--sp-2); }
.pc-note { display: flex; align-items: center; gap: var(--sp-1); color: var(--text-2); }
.pc-note.is-warn { color: var(--highlight-text); }
.pc-actions { display: flex; flex-wrap: wrap; gap: var(--sp-2); }

/* ------------------------------------------------- the product editor --- */
.pe-card { display: flex; flex-direction: column; gap: var(--sp-5); padding: var(--sp-6); max-width: 760px; }
.pe-tag-list { display: flex; flex-wrap: wrap; gap: var(--sp-1); min-height: 4px; }
.pe-tag-list .pc-tag { display: inline-flex; align-items: center; gap: var(--sp-1); }
.pe-tag-x { all: unset; display: inline-grid; place-items: center; width: 16px; height: 16px; border-radius: var(--r-full); cursor: pointer; color: var(--text-muted); }
.pe-tag-x:focus-visible { box-shadow: var(--focus-ring); }
.pe-tag-add { display: flex; gap: var(--sp-2); align-items: center; max-width: 360px; }
.pe-mods { display: flex; flex-direction: column; gap: var(--sp-2); }
.pe-mods-head { display: flex; align-items: center; justify-content: space-between; gap: var(--sp-3); }
.pe-mods-title { font-size: var(--fs-14); font-weight: var(--fw-semibold); }
.pe-mod-list { list-style: none; margin: 0; padding: 0; border: 1px solid var(--line); border-radius: var(--r-card); }
.pe-mod { display: flex; align-items: center; gap: var(--sp-3); padding: var(--sp-2) var(--sp-3); }
.pe-mod + .pe-mod { border-top: 1px solid var(--line-soft); }
.pe-mod-n { width: 20px; color: var(--text-muted); font-size: var(--fs-12); text-align: right; }
.pe-mod-text { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.pe-mod-name { font-weight: var(--fw-medium); }
.pe-mod-acts { display: inline-flex; gap: var(--sp-1); }
.pe-line, .yb-live { display: flex; align-items: center; gap: var(--sp-1); font-size: var(--fs-13); color: var(--text-2); }
.pe-problem, .yb-problem { display: flex; align-items: center; flex-wrap: wrap; gap: var(--sp-1); color: var(--highlight-text); font-size: var(--fs-13); }
.pe-switches { display: grid; gap: var(--sp-4); }
.pe-pick { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: var(--sp-2); }

/* ------------------------------------------------------ Your products --- */
.yp-toolbar { display: flex; align-items: center; flex-wrap: wrap; gap: var(--sp-3); }
.yp-toolbar .input-wrap { flex: 1 1 220px; max-width: 320px; }
.yp-section { display: flex; flex-direction: column; gap: var(--sp-4); }
.yp-section-title { font-size: var(--fs-16); font-weight: var(--fw-semibold); }
.yp-empty { padding: var(--sp-2) 0; }

/* -------------------------------------------- Build a product (dialog) --- */
.yb { display: grid; grid-template-columns: 1fr 1fr; gap: var(--sp-5); margin-bottom: var(--sp-4); }
@media (max-width: 720px) { .yb { grid-template-columns: 1fr; } }
.yb-col { display: flex; flex-direction: column; gap: var(--sp-2); min-width: 0; }
.yb-col.is-mine { padding: var(--sp-3); border-radius: var(--r-card); background: var(--bg-sunken); }
.yb-title { font-size: var(--fs-13); font-weight: var(--fw-semibold); color: var(--text-2); }
.yb-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: var(--sp-2); max-height: 420px; overflow-y: auto; }
.yb-mod { display: flex; align-items: flex-start; gap: var(--sp-2); padding: var(--sp-2); border: 1px solid var(--line); border-radius: var(--r-control); background: var(--bg-surface); }
.yb-mod-text { flex: 1; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.yb-mod-name { font-weight: var(--fw-medium); }
.yb-mod-desc { color: var(--text-muted); }
.yb-mod-acts { display: flex; flex-wrap: wrap; gap: var(--sp-1); justify-content: flex-end; }
/* A module to add: its words first, full width, then See sample pages and Add under them. */
.yb-mod:not(.is-in) { flex-direction: column; align-items: stretch; }
.yb-mod:not(.is-in) .yb-mod-acts { justify-content: flex-start; }
.yb-n { width: 18px; color: var(--text-muted); font-size: var(--fs-12); padding-top: 2px; }

/* -------------------------------------------- a module's sample pages --- */
.ylib-sample-drawer .drawer-body { padding: 0; gap: 0; }
.ylib-sample { display: flex; flex-direction: column; min-height: 100%; }
.ylib-sample > .empty-state, .ylib-sample > .banner, .ylib-sample > .skeleton { margin: var(--sp-5); }
.ylib-sample-bar { display: flex; align-items: center; flex-wrap: wrap; gap: var(--sp-2) var(--sp-3); padding: var(--sp-3) var(--sp-5); border-bottom: 1px solid var(--line-soft); background: var(--bg-surface); position: sticky; top: 0; z-index: 1; }
.ylib-sample-stage { flex: 1; }
