/* robotparts.dev part lists (static/lists.js, docs/peps/0004-lists-composites-and-tests.md §3, §11): "Add to list" and
   its menu on a part page, the list page's head, its cards' Qty line and the Assemble dialog. Only site.css's tokens,
   so light and dark follow it; the shapes copy account.css's (the heart, the account menu). */

/* ---- Add to list, beside the heart ---------------------------------------------------------------------------- */
.ls-wrap { position: relative; display: inline-block; vertical-align: middle; margin: 0 0 8px 6px; }
.pactions .ls-wrap { margin: 0; }
.pactions .ls-add { border-radius: 3px; }
/* WHY: on a phone the button can end the row, and a menu hung from it runs off the window; it hangs from the row instead */
@media (max-width: 640px) { .pactions { position: relative; } .pactions .ls-wrap { position: static; } }
.ls-add { height: 30px; padding: 0 12px; border: 1px solid var(--rule); border-radius: 999px; background: var(--bg2); color: var(--ink2); font: inherit; font-weight: 600; font-size: 13px; cursor: pointer; }
.ls-add:hover { color: var(--accent); border-color: var(--ink3); }
.ls-add[aria-expanded="true"] { border-color: var(--accent); color: var(--accent); }
.ls-add:focus-visible, .ls-item:focus-visible, .ls-step:focus-visible, .ls-remove:focus-visible, .ls-assemble:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.ls-menu { position: absolute; z-index: 60; top: calc(100% + 6px); left: 0; width: min(20rem, calc(100vw - 24px)); background: var(--bg); border: 1px solid var(--rule); border-radius: 4px; box-shadow: 0 6px 24px rgba(0, 0, 0, .14); padding: 6px 0; font-size: 13.5px; }
.ls-h { margin: 2px 14px 6px; color: var(--ink2); font-size: 12px; font-weight: 650; text-transform: uppercase; letter-spacing: .03em; }
.ls-hint { margin: 4px 14px 8px; color: var(--ink2); font-size: 12.5px; }
/* WHY full-width rows: as the account menu, one list a finger or the Tab key walks top to bottom */
.ls-item { display: flex; align-items: center; gap: 8px; width: 100%; min-height: 34px; padding: 6px 14px; border: 0; border-radius: 0; background: none; color: var(--ink); text-align: left; font: inherit; cursor: pointer; }
.ls-item:hover { background: var(--hover); }
.ls-item:disabled { opacity: .6; cursor: default; }
.ls-check { flex: none; width: 14px; color: var(--accent); font-weight: 700; }
.ls-option .ls-name { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.ls-option[aria-checked="true"] .ls-name { font-weight: 650; }
.ls-count { color: var(--ink2); font-size: 12.5px; font-variant-numeric: tabular-nums; }
.ls-new { display: flex; gap: 6px; padding: 2px 14px 8px; }
.ls-new input { flex: 1; min-width: 0; height: 30px; border: 1px solid var(--rule); border-radius: 3px; background: var(--bg); color: var(--ink); padding: 0 8px; font: inherit; }
.ls-new input:focus { outline: 2px solid var(--accent); outline-offset: -1px; }
.ls-new button { flex: none; height: 30px; padding: 0 10px; }
.ls-status { margin: 4px 14px; color: var(--ink2); font-size: 12.5px; }
.ls-status:empty { display: none; }
.ls-foot { display: block; margin-top: 4px; padding: 6px 14px 2px; border-top: 1px solid var(--rule2); font-size: 12.5px; }

/* ---- the Account menu and /saved/ ------------------------------------------------------------------------------- */
[data-rp-slot="lists"] a[data-rp="list-link"] .ls-count { margin-left: 4px; }
.ls-links { padding-left: 18px; }
.ls-links li { margin: 6px 0; }

/* ---- /saved/list/ --------------------------------------------------------------------------------------------- */
.ls-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 6px 16px; }
/* WHY pre-wrap: a list's name is shown as written (truthful rendering), two spaces included */
.ls-head h1, .ls-name { white-space: pre-wrap; }
.ls-head h1 { min-width: 0; overflow-wrap: anywhere; }
.ls-actions { display: flex; align-items: center; gap: 10px; }
.ls-actions[hidden] { display: none; }
.ls-actions .ls-status { margin: 0; }
.ls-assemble, .ls-primary { height: 32px; padding: 0 14px; border: 1px solid var(--accent); border-radius: 3px; background: var(--accent); color: var(--on-accent); font: inherit; font-weight: 600; cursor: pointer; }
.ls-meta { margin-top: 0; font-size: 13px; }
.ls-meta code { font-size: 12px; overflow-wrap: anywhere; }
data-views#list-views[hidden] { display: none; }
/* the Qty line of a card: − n + and Remove, inside the line data-ui already sized the card for */
#list-views .dv-cards-value:has(> .ls-qty) { display: inline-flex; align-items: center; gap: 8px; }
.ls-qty { display: inline-flex; align-items: center; border: 1px solid var(--rule); border-radius: 3px; }
.ls-step { width: 22px; height: 20px; padding: 0; border: 0; background: none; color: var(--ink2); font: inherit; line-height: 1; cursor: pointer; }
.ls-step:hover:not(:disabled) { color: var(--accent); background: var(--hover); }
.ls-step:disabled { opacity: .4; cursor: default; }
.ls-n { min-width: 18px; text-align: center; font-variant-numeric: tabular-nums; }
.ls-remove { padding: 0; border: 0; background: none; color: var(--ink2); font: inherit; font-size: 12px; text-decoration: underline; text-underline-offset: 2px; cursor: pointer; }
.ls-remove:hover { color: var(--warn); }

/* ---- the Assemble dialog --------------------------------------------------------------------------------------- */
.ls-dialog { width: min(32rem, calc(100vw - 32px)); max-height: calc(100vh - 48px); padding: 18px 20px; border: 1px solid var(--rule); border-radius: 4px; background: var(--bg); color: var(--ink); box-shadow: 0 10px 40px rgba(0, 0, 0, .25); }
.ls-dialog::backdrop { background: rgba(0, 0, 0, .35); }
.ls-dialog h2 { margin: 0 0 6px; font-size: 18px; }
.ls-dialog p { margin: 4px 0 10px; }
.ls-pick { list-style: none; margin: 8px 0 12px; padding: 0; border: 1px solid var(--rule2); border-radius: 3px; }
.ls-pick li + li { border-top: 1px solid var(--rule2); }
.ls-pick label { display: block; padding: 7px 10px; cursor: pointer; overflow-wrap: anywhere; }
.ls-pick label:hover { background: var(--hover); }
.ls-label { display: block; font-weight: 600; font-size: 12.5px; margin-bottom: 4px; }
.ls-dialog input[type="text"] { width: 100%; box-sizing: border-box; height: 32px; border: 1px solid var(--rule); border-radius: 3px; background: var(--bg); color: var(--ink); padding: 0 8px; font: inherit; }
.ls-dialog .ls-status { margin: 4px 0; }
.ls-id code { font-size: 12px; overflow-wrap: anywhere; }
.ls-row { display: flex; gap: 8px; margin-top: 12px; }
.ls-row button { height: 32px; padding: 0 14px; }
.ls-primary:disabled { opacity: .5; cursor: default; }
