/* Python Blocks: modules.js. The Modules button under the categories
   (Scratch's Add Extension) and the one by the search box, and the Modules
   list: a search box that stays put, then each group's modules as rows with
   their colour, name, import line, one plain line, and Add or Remove. */
.pb-mod-btn { display: grid; justify-items: center; gap: 3px; width: 100%; min-height: 56px; margin: 6px 0 0; padding: 8px 2px; color: var(--muted); background: transparent; border: 0; border-top: 1px solid var(--border); font: 600 0.62rem/1.15 Inter, system-ui, sans-serif; cursor: pointer; }
.pb-mod-btn:hover, .pb-mod-btn:focus-visible { color: var(--text); background: #262136; }
.pb-mod-plus { display: grid; place-items: center; width: 22px; height: 22px; color: #fff; background: #6f5bd6; border-radius: 50%; font: 700 1rem/1 Inter, system-ui, sans-serif; }
@media (max-width: 760px) { .pb-mod-btn { font-size: 0.56rem; } }

/* The list. */
.pb-mods { display: grid; gap: 14px; }
.pb-mod-top { position: sticky; top: -12px; z-index: 1; display: grid; gap: 6px; margin: -12px -18px 0; padding: 12px 18px 10px; background: var(--surface); border-bottom: 1px solid var(--border); }
.pb-mod-search { width: 100%; min-height: 42px; font-size: 16px; }
.pb-mod-count { margin: 0; color: var(--muted); font-size: 0.8rem; }
.pb-mod-err { margin: 0; color: #ff8b8b; font-size: 0.82rem; }
.pb-mod-err:empty { display: none; }
.pb-mod-groups { display: grid; gap: 18px; }
.pb-mod-head { margin: 0; color: var(--accent-strong); font: 600 0.66rem var(--mono); letter-spacing: 0.08em; text-transform: uppercase; }
.pb-mod-hint { margin: 2px 0 8px; color: var(--faint); font-size: 0.76rem; }
.pb-mod-list { display: grid; gap: 6px; margin: 0; padding: 0; list-style: none; }
.pb-mod-row { display: flex; align-items: center; gap: 8px; min-height: 54px; padding: 4px 6px 4px 4px; background: var(--surface-2); border: 1px solid var(--border); border-radius: 0; }
.pb-mod-row.is-on { border-color: rgba(139, 92, 246, 0.55); }
.pb-mod-name { display: flex; flex: 1 1 auto; align-items: center; gap: 10px; min-width: 0; padding: 6px; color: var(--text); background: none; border: 0; border-radius: 0; font: inherit; text-align: left; }
button.pb-mod-name { cursor: pointer; }
button.pb-mod-name:focus-visible { outline: none; box-shadow: var(--focus-ring); }
@media (hover: hover) { button.pb-mod-name:hover .pb-mod-title b { color: var(--gold); } }
.pb-mod-dot { flex: none; width: 16px; height: 16px; border-radius: 50%; box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.15); }
.pb-mod-text { display: grid; gap: 2px; min-width: 0; }
.pb-mod-title { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 8px; }
.pb-mod-title b { font-size: 0.9rem; }
.pb-mod-title code { color: var(--muted); font: 0.72rem var(--mono); }
.pb-mod-text small { color: var(--muted); font-size: 0.76rem; line-height: 1.35; }
.pb-mod-state { flex: none; padding: 3px 8px; border-radius: 0; font: 600 0.62rem var(--mono); letter-spacing: 0.06em; text-transform: uppercase; white-space: nowrap; }
.pb-mod-state.is-on { color: var(--tint-text); background: var(--tint); }
.pb-mod-state.is-used { color: var(--muted); border: 1px solid var(--border); }
.pb-mod-acts { display: flex; flex: none; gap: 4px; }
.pb-mod-act { min-width: 64px; min-height: 36px; }
.pb-mod-remove { color: #ff8b8b; }
.pb-mod-none { margin: 0; color: var(--muted); font-size: 0.84rem; }
.pb-mod-link { padding: 0; color: var(--accent-strong); background: none; border: 0; font: inherit; text-decoration: underline; cursor: pointer; }
@media (max-width: 760px) {
  .pb-mod-row { flex-wrap: wrap; padding: 4px 6px 6px 4px; }
  .pb-mod-name { flex-basis: 100%; }
  .pb-mod-state { margin-left: 32px; }
  .pb-mod-acts { margin-left: auto; }
  .pb-mod-act { min-height: 40px; }
}
