/* Supplier-facing primitives (supplier-ui.js): StateChip, ProposalCard, SupplierShell. Needs styles.css (tokens) only. */
.state-chip { display: inline-flex; align-items: center; gap: 6px; height: 24px; padding: 0 10px 0 8px; border-radius: var(--r-pill); background: var(--bg-chrome); color: var(--text-2); font-size: var(--fs-meta); font-weight: var(--w-medium); white-space: nowrap; }
.state-chip .glyph { width: 14px; height: 14px; flex: none; }
.pcard { display: grid; gap: 8px; padding: 12px 14px; border: 0.5px solid var(--line-2); border-radius: var(--r-surface); background: var(--bg-raised); }
.pcard:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.pcard-fact { color: var(--text-1); font-weight: var(--w-medium); }
.pcard-note { margin: 0; color: var(--text-2); font-style: normal; }
.pcard-note::before { content: '“'; } .pcard-note::after { content: '”'; }
.pcard-by, .pcard-cons { color: var(--text-3); font-size: var(--fs-meta); }
.pcard-act, .pcard-why { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.pcard-why-h { color: var(--text-3); margin-right: 4px; }
.pcard-blocked { color: var(--text-3); font-size: var(--fs-meta); }
.pcard-sign { display: flex; align-items: center; gap: 6px; color: var(--text-2); }
.pcard-sign .glyph { width: 14px; height: 14px; }
.pcard-out { margin-left: 6px; color: var(--text-3); }
.pcard.s-stale { background: var(--bg-canvas); color: var(--text-3); }
.pcard.s-stale .pcard-fact, .pcard.s-stale .pcard-note { color: var(--text-3); }
/* SupplierShell: the collaboration prototype's composition (tenant header, workbook, dock, pill, footer) on the real tokens. */
:root { --sw-side: 408px; --t-slow: 350ms; --shadow-float: 0 6px 18px lch(0 0 0 / .02), 0 3px 9px lch(0 0 0 / .04), 0 1px 1px lch(0 0 0 / .04); }
.swroot { height: 100vh; display: flex; flex-direction: column; background: var(--bg-canvas); position: relative; color: var(--text-1); }
.swroot .spacer { flex: 1; }
.sw-top { display: flex; align-items: center; gap: 14px; height: 52px; padding: 0 24px; border-bottom: 0.5px solid var(--line-2); flex: none; }
.sw-brand { display: inline-flex; align-items: center; gap: 8px; font-weight: var(--w-medium); letter-spacing: -.01em; }
.sw-logo { width: 24px; height: 24px; border-radius: 6px; background: var(--text-1); color: var(--bg-canvas); display: grid; place-items: center; font-size: 12px; }
.sw-for { color: var(--text-3); font-weight: var(--w-normal); }
.sw-me { display: inline-flex; align-items: center; gap: 8px; color: var(--text-2); }
.sw-stage { flex: 1; min-height: 0; position: relative; overflow: hidden; }
.sw-wb { min-width: 0; min-height: 0; display: flex; flex-direction: column; overflow: hidden; padding: 20px 28px 0; }
.sw-title { display: flex; align-items: center; gap: 8px; flex: none; margin: 0 0 14px; }
.sw-title .spacer { flex: 1; }
.sw-wb h1 { font-size: 20px; font-weight: var(--w-semibold); letter-spacing: -.01em; margin: 0; }
.sw-key { flex: none; display: flex; flex-wrap: wrap; align-items: center; gap: 4px 14px; padding: 0 0 10px; color: var(--text-3); font-size: var(--fs-meta); }
.sw-key > span { display: inline-flex; align-items: center; gap: 5px; }
.sw-grid { flex: 1; min-height: 0; overflow: auto; padding-bottom: 72px; }
.sw-dock { position: absolute; top: 0; right: 0; bottom: 0; width: var(--sw-side); max-width: 100%; pointer-events: none; z-index: 3; }
.sw-stage[data-open="true"] .sw-dock { pointer-events: auto; }
.sw-layer { position: absolute; top: 8px; right: 8px; bottom: 8px; width: calc(var(--sw-side) - 8px); display: flex; flex-direction: column; min-height: 0; background: var(--bg-raised); border: 0.5px solid var(--line-2); border-radius: var(--r-surface); box-shadow: var(--shadow-float); opacity: 0; transform: translateX(12px) scale(.99); transform-origin: right center; visibility: hidden; overflow: auto; transition: opacity 150ms var(--ease), transform 150ms var(--ease), visibility 0s linear 150ms; }
.sw-stage[data-open="true"] .sw-layer { opacity: 1; transform: none; visibility: visible; transition: opacity var(--t-regular) var(--ease) 100ms, transform var(--t-regular) var(--ease) 100ms, visibility 0s; }
@media (max-width: 860px) { .sw-layer { width: calc(100% - 8px); } }
@media (prefers-reduced-motion: reduce) { .sw-stage { transition: none; } .sw-layer, .sw-stage[data-open="true"] .sw-layer { transform: none; } }
.sw-pill { position: absolute; right: 24px; bottom: 56px; z-index: 20; display: inline-flex; align-items: center; gap: 8px; height: 36px; padding: 0 14px 0 6px; border-radius: var(--r-pill); border: 0.5px solid var(--line-2); background: var(--bg-raised); box-shadow: var(--shadow-float); font: inherit; font-size: var(--fs-ui); color: var(--text-2); cursor: pointer; transition: opacity var(--t-regular) var(--ease) 380ms, transform var(--t-regular) var(--ease) 380ms; }
.swroot:has(.sw-stage[data-open="true"]) .sw-pill { opacity: 0; transform: translateY(6px); pointer-events: none; transition-delay: 0ms; transition-duration: 100ms; }
.sw-pill:hover { color: var(--text-1); }
.sw-pill .avatar { width: 24px; height: 24px; font-size: var(--fs-micro); }
.sw-pill .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--pn-sel, var(--accent)); box-shadow: 0 0 0 2px var(--bg-raised); margin-left: -14px; margin-top: 16px; }
.sw-pill b { color: var(--text-1); font-weight: var(--w-semibold); }
.sw-foot { display: flex; align-items: center; gap: 12px; padding: 10px 24px; border-top: 0.5px solid var(--line-1); flex: none; color: var(--text-3); font-size: var(--fs-meta); }
.sw-powered b { color: var(--text-2); font-weight: var(--w-medium); }
@media (max-width: 860px) { .sw-top { padding: 0 16px; } .sw-wb { padding: 16px 16px 0; } .sw-foot { padding: 10px 16px; flex-wrap: wrap; } .sw-pill { right: 16px; } }
.glyph.g-planned, .glyph.g-packing, .glyph.g-moved { color: var(--text-3); }
.glyph.g-packing { --fill: var(--progress); }
.glyph.g-shipped { color: var(--op-done); }
.glyph.g-cancelled { color: var(--neutral); }
.pcard-ref { justify-self: start; display: inline-flex; align-items: center; height: 22px; padding: 0 8px; border-radius: var(--r-pill); background: var(--bg-chrome); color: var(--text-2); font-size: var(--fs-meta); font-variant-numeric: tabular-nums; text-decoration: none; }
.pcard-ref:hover, .pcard-ref:focus-visible { color: var(--text-1); background: var(--bg-hover); }
.pcard-mail { display: inline-flex; align-items: center; gap: 4px; margin-left: 8px; color: var(--text-3); }
.pcard-mail .ico { width: 12px; height: 12px; }
/* The dock inside, the Plan page's chat grammar (.pn-chat): header, padded stream, empty state, composer. */
.sw-layer { overflow: hidden; }
.sw-lh { display: flex; align-items: center; gap: 8px; padding: 12px 10px 4px 16px; font-size: var(--fs-ui); min-width: 0; flex: none; }
.sw-lh b { font-weight: var(--w-medium); white-space: nowrap; }
.sw-lh .here { color: var(--text-3); font-size: var(--fs-meta); font-weight: var(--w-normal); min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sw-lh .sp, .sw-cbar .sp { flex: 1; }
.sw-stream { flex: 1; min-height: 0; overflow: auto; padding: 8px 16px 16px; display: grid; gap: 10px; align-content: start; }
.sw-empty { margin: 8px 0; color: var(--text-3); font-size: var(--fs-meta); font-weight: var(--w-normal); }
.sw-composer { margin: 0 12px 12px; border: 0.5px solid var(--line-2); border-radius: 10px; background: var(--bg-canvas); padding: 8px 8px 6px 12px; flex: none; }
.sw-composer:focus-within { border-color: var(--accent-ring); }
.sw-composer textarea { display: block; width: 100%; box-sizing: border-box; border: 0; background: none; resize: none; font: inherit; font-weight: var(--w-normal); color: var(--text-1); line-height: 1.5; padding: 2px 0; outline: none; }
.sw-composer textarea::placeholder { color: var(--text-3); }
.sw-cbar { display: flex; align-items: center; gap: 8px; margin-top: 4px; }
.sw-composer .send { width: 28px; height: 28px; border-radius: 50%; border: 0; background: var(--accent); color: #fff; display: grid; place-items: center; cursor: pointer; }
.sw-composer .send .ico { width: 15px; height: 15px; }
.sw-composer .send:disabled { background: var(--bg-pressed); color: var(--text-3); cursor: default; }
/* The key line's sample marks: the figure, the unconfirmed figure (dotted underline, as the Plan page), and Purchasing's yellow cell. */
.sw-key .sw-fig { color: var(--text-1); font-weight: var(--w-medium); font-variant-numeric: tabular-nums; }
.sw-key .sw-legend { display: inline-flex; align-items: center; gap: 5px; padding: 2px 6px; margin: -2px -6px; border: 0; border-radius: 6px; background: none; color: inherit; font: inherit; cursor: pointer; }
.sw-key .sw-legend:hover { background: var(--bg-hover); }
.sw-key .sw-legend.on { background: var(--bg-hover); color: var(--text-1); }
.sw-key .sw-legend:focus-visible { outline: 2px solid var(--accent-ring); outline-offset: 1px; }
.sw-key .sw-add { display: inline-block; width: 18px; height: 12px; border-radius: 3px; background: var(--pm-add); box-shadow: inset 0 0 0 0.5px var(--line-3); }

/* The dock's mode switch (bolt = SKUBA, bubble = the thread): the Plan page's, moved here so the supplier page serves it. */
.sc-modes { display: inline-flex; gap: 2px; padding: 2px; border-radius: var(--r-pill); background: var(--bg-chrome); }
.sc-modes .iconbtn { width: 26px; height: 26px; border-radius: var(--r-pill); position: relative; color: var(--text-3); }
.sc-modes .iconbtn:hover { color: var(--text-1); }
.sc-modes .iconbtn.on { background: var(--bg-raised); color: var(--text-1); box-shadow: 0 1px 2px lch(0 0 0 / .08); }
.sc-modes .sc-badge { position: absolute; top: -4px; right: -4px; margin: 0; box-shadow: 0 0 0 1.5px var(--bg-chrome); }
.sc-modes .iconbtn:disabled { opacity: .4; cursor: default; }
/* The grid's toolbar, the filter/view popover and the side panel (supplier chrome). */
.sw-bar { display: flex; align-items: center; gap: 4px; }
.sw-bar .spacer { flex: 1; }
.sw-bar .iconbtn { position: relative; }
.sw-bar .iconbtn.on, .sw-bar .iconbtn[aria-pressed="true"] { color: var(--text-1); background: var(--bg-hover); }
.sw-dotmark { position: absolute; top: 4px; right: 4px; width: 6px; height: 6px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 1.5px var(--bg-canvas); }
.sw-menu { position: fixed; z-index: 60; padding: 4px 0; background: var(--bg-raised); border: 0.5px solid var(--line-2); border-radius: var(--r-surface); box-shadow: var(--shadow-float); }
.sw-menu .menu-item { width: 100%; text-align: left; }
.sw-menu .sw-tick { width: 16px; display: inline-grid; place-items: center; flex: none; }
.sw-menu .sw-tick .ico { width: 14px; height: 14px; color: var(--text-1); }
.sw-wb { height: 100%; box-sizing: border-box; position: relative; z-index: 0; } /* its own stacking context: the sticky header rows never rise above the panels */
.sw-side { display: none; position: absolute; top: 8px; bottom: 8px; right: 8px; width: 320px; max-width: calc(100% - 16px); overflow: auto; padding: 0; pointer-events: none; z-index: 2; transition: right var(--t-regular) var(--ease); }
.sw-side .rcard { pointer-events: auto; margin: 0 0 8px; }
.sw-stage[data-side="true"] .sw-side { display: block; }
.sw-stage[data-open="true"] .sw-side { right: var(--sw-side); }
@media (max-width: 860px) { .sw-stage[data-open="true"] .sw-side { display: none; } }
/* The thread: a message (collab `.msg`), the supplier's own request card, the side panel's lists and notes, the hover text. */
.sw-msg { padding: 2px 6px; margin: 0 -6px; border-radius: 8px; }
.sw-msg-h { display: flex; align-items: baseline; gap: 8px; margin-bottom: 2px; }
.sw-msg-h .avatar { width: 20px; height: 20px; font-size: var(--fs-micro); align-self: center; }
.sw-msg-h b { font-weight: var(--w-medium); }
.sw-msg-h .when { color: var(--text-3); font-weight: var(--w-normal); font-size: var(--fs-meta); }
.sw-msg p { margin: 0 0 2px 28px; line-height: 1.55; font-weight: var(--w-normal); color: var(--text-1); }
.sw-msg .pcard-ref { margin: 2px 0 0 28px; }
.sw-msg.mine p { color: var(--text-1); }
.pcard.mine { background: var(--bg-raised); }
.pcard.mine.s-stale, .pcard.mine.s-withdrawn { background: var(--bg-canvas); color: var(--text-3); }
.sw-hc { position: fixed; z-index: 70; max-width: 360px; padding: 8px 10px; background: var(--bg-raised); border: 0.5px solid var(--line-2); border-radius: var(--r-surface); box-shadow: var(--shadow-float); font-size: var(--fs-meta); font-weight: var(--w-normal); color: var(--text-2); line-height: 1.5; white-space: pre-wrap; pointer-events: none; }
/* The gate: the link's landing page (access code) and the refusal page. */
.sw-gate { min-height: 100vh; display: flex; flex-direction: column; background: var(--bg-canvas); color: var(--text-1); }
.sw-gate-top { display: flex; align-items: center; height: 52px; padding: 0 24px; border-bottom: 0.5px solid var(--line-2); flex: none; }
.sw-gate-card { margin: 12vh auto 0; width: min(100% - 32px, 380px); padding: 28px 28px 24px; background: var(--bg-raised); border: 0.5px solid var(--line-2); border-radius: var(--r-surface); box-shadow: var(--shadow-float); }
.sw-gate-card h1 { margin: 0 0 8px; font-size: 20px; font-weight: var(--w-semibold); letter-spacing: -.01em; }
.sw-gate-card p { margin: 0 0 16px; color: var(--text-2); font-weight: var(--w-normal); line-height: 1.5; }
.sw-gate-card.refused p { margin-bottom: 0; }
.sw-gate-form { display: grid; gap: 8px; }
.sw-gate-form label { color: var(--text-2); font-size: var(--fs-meta); }
.sw-gate-code { box-sizing: border-box; width: 100%; height: 44px; padding: 0 12px; border: 0.5px solid var(--line-2); border-radius: 10px; background: var(--bg-canvas); font: inherit; font-size: 22px; letter-spacing: .5em; text-align: center; font-variant-numeric: tabular-nums; color: var(--text-1); outline: none; }
.sw-gate-code:focus { border-color: var(--accent-ring); }
.sw-gate-code[aria-invalid="true"] { border-color: var(--danger); }
.sw-gate-err { margin: 0 !important; color: var(--danger); font-size: var(--fs-meta); }
.sw-gate-form .btn.primary { justify-content: center; margin-top: 4px; height: 36px; }
.sw-gate .sw-foot { margin-top: auto; border-top: 0.5px solid var(--line-1); }
.sw-gate .spacer { flex: 1; }

/* The side cart (rcard sections and the rows inside them): moved out of frame.css so the Plan page and the supplier page serve ONE copy. */
.rcard { background: var(--bg-raised); border: 1px solid var(--line-1); border-radius: var(--r-control); margin: 0 0 10px; }
.rcard > summary { display: flex; align-items: center; gap: 6px; height: 40px; padding: 0 12px; list-style: none; cursor: default; color: var(--text-1); font-weight: var(--w-medium); font-size: var(--fs-ui); }
.rcard > summary::-webkit-details-marker { display: none; }
.rcard > summary .caret { width: 12px; height: 12px; color: var(--text-4); transition: transform var(--t-quick) var(--ease); }
.rcard:not([open]) > summary .caret { transform: rotate(-90deg); }
.rcard > summary:hover .caret, .rcard > summary:focus-visible .caret { color: var(--text-2); }
.rcard > summary .rc-act { margin-left: auto; color: var(--text-3); display: inline-flex; }
.rc-body { padding: 0 12px 8px; }
.pk-sec .pk-scroll { max-height: 34vh; overflow: auto; padding: 0; }
.pk-sec .pk-foot { margin: 6px -12px -8px; padding: 0 12px; border-top: 0.5px solid var(--line-1); }
.pk-sec .pk-note::placeholder { color: var(--text-4); }
.pk-sec .rc-body { color: var(--text-2); }
.pk-sec .pn-empty { margin: 4px 0 8px; color: var(--text-3); }
.pk-sec .sc-day { margin: 14px 0 0; color: var(--text-3); font-size: var(--fs-meta); font-weight: var(--w-normal); }
.pk-sec .sc-day:first-child { margin-top: 4px; }
.pk-sec .sc-row { padding: 8px 0 2px; }
.pk-sec .sc-row .mh { gap: 8px; font-size: var(--fs-meta); color: var(--text-3); }
.pk-sec .sc-row .mh .ico { display: none; }
.pk-sec .sc-row .mh b { color: var(--text-2); font-weight: var(--w-medium); }
.pk-sec .sc-row p { margin: 2px 0 0; color: var(--text-2); line-height: 1.45; }
.pk-sec .sc-mail { margin: 0 -8px; padding: 8px; }
.pk-sec .sc-mail-h b, .pk-sec .sc-mail-s { color: var(--text-1); }
.pk-sec .sc-mail-p { color: var(--text-3); }
.pk-sec .sc-row p, .pk-sec .sc-mail-s, .pk-sec .sc-mail-p, .pk-sec .sc-row .mh, .pk-sec .pn-empty { font-weight: var(--w-normal); }
.pk-sec .sc-mail.unread .sc-mail-h b, .pk-sec .sc-mail.unread .sc-mail-s { font-weight: var(--w-medium); }
.sc-mail { display: flex; gap: 10px; padding: 8px 6px; margin: 0 -6px; border-radius: var(--r-control); }
.sc-mail:hover, .sc-mail:focus-visible { background: var(--bg-hover); outline: none; }
.sc-mail .avatar { width: 28px; height: 28px; font-size: 10px; font-weight: var(--w-semibold); }
.sc-mail-t { min-width: 0; flex: 1; }
.sc-mail-h { display: flex; align-items: baseline; gap: 8px; }
.sc-mail-h b { color: var(--text-1); font-weight: var(--w-medium); flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sc-mail.unread .sc-mail-h b, .sc-mail.unread .sc-mail-s { font-weight: var(--w-semibold); }
.sc-mail-h .when { color: var(--text-3); font-size: var(--fs-meta); font-weight: var(--w-normal); flex: none; }
.sc-mail-s { color: var(--text-1); font-weight: var(--w-normal); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sc-mail-p { color: var(--text-3); font-weight: var(--w-normal); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sc-day { margin: 10px 0 2px; color: var(--text-3); font-size: var(--fs-micro); font-weight: var(--w-medium); }
.sc-row .mh { display: flex; align-items: center; gap: 6px; }
.sc-row .mh .ico { width: 13px; height: 13px; color: var(--text-3); }
.sc-row .mh .when { color: var(--text-3); font-weight: var(--w-normal); }
.sc-row .sc-title { margin: 2px 0 0; color: var(--text-1); font-weight: var(--w-medium); }
.sc-row p { margin: 2px 0 0; }
.pk-sec .pk-note, .pplan .pn-side2 .pk-note { display: block; width: 100%; box-sizing: border-box; height: 38px; padding: 0; border: 0; border-radius: 0; background: none; box-shadow: none; outline: 0; font: inherit; color: var(--text-1); }
/* Presence (S3): the dock header's quiet "Live" while the other side is in the page; the pill's dot is `.sw-pill .dot` (supplierShell `live`). */
.sw-live { display: inline-flex; align-items: center; gap: 5px; color: var(--text-3); font-size: var(--fs-meta); font-weight: var(--w-normal); }
.sw-live .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--pn-sel); }
/* NotifyBadge: a number that means "something waits for you". White on the primary green, a pill; sizes stay the quiet grey RailCount. */
.nbadge { display: inline-flex; align-items: center; justify-content: center; flex: none; min-width: 16px; height: 16px; padding: 0 5px; margin-left: 6px; border-radius: var(--r-pill); background: var(--accent-fill); color: #fff; font-size: var(--fs-micro); font-weight: var(--w-medium); font-variant-numeric: tabular-nums; line-height: 1; vertical-align: 1px; }
.nbadge.trail { margin-left: auto; }
/* The "Recently received" row: one line, date then item · quantity · PO, no clock. */
.sc-rcv { display: grid; grid-template-columns: 44px minmax(0, 1fr); gap: 8px; align-items: baseline; padding: 4px 0; font-size: var(--fs-meta); }
.sc-rcv .when { color: var(--text-3); font-weight: var(--w-normal); white-space: nowrap; }
.sc-rcv .what { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text-2); font-weight: var(--w-normal); font-variant-numeric: tabular-nums; }
.sc-rcv .what b { color: var(--text-1); font-weight: var(--w-medium); }
/* One scroll container: the grid. A .pg-wrap inside it does not scroll on its own, so the header rows stay sticky. */
.sw-grid .pg-wrap { overflow: visible; margin: 0; flex: none; }

