
  .pg-toolbar { align-items: center; }
  .pg-toolbar .ghost { display: inline-flex; align-items: center; gap: 7px; }
  .pg-toolbar .ghost svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
  .pg-check { display: inline-flex; align-items: center; gap: 8px; color: var(--muted); font-size: .92rem; cursor: pointer; }
  .pg-check select { background: var(--card); color: var(--text); border: 1px solid var(--border); border-radius: 8px; padding: 6px 8px; font: inherit; }
  .pg-count { color: var(--muted); font-size: .9rem; min-height: 1.3em; margin: 2px 0 6px; }
  .pg-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 16px; padding: 6px 0 4px; }
  .pg-thumb { position: relative; display: flex; flex-direction: column; align-items: center; padding: 10px 8px 8px; border: 2px solid var(--border); border-radius: 12px;
    background: var(--card); text-align: center; user-select: none; transition: border-color .15s ease, background .15s ease, box-shadow .2s ease, opacity .2s ease; }
  .pg-thumb:hover { border-color: color-mix(in srgb, var(--accent) 55%, var(--border)); }
  .pg-thumb:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
  .pg-ph { position: relative; width: 130px; height: var(--box, 184px); display: grid; place-items: center; }
  .pg-slot { display: grid; place-items: center; }
  .pg-slot canvas { display: block; background: #fff; box-shadow: 0 2px 8px rgba(0, 0, 0, .28); border-radius: 2px; }
  .pg-slot:empty { width: 130px; height: 170px; border-radius: 4px; background: linear-gradient(100deg, transparent 30%, color-mix(in srgb, var(--muted) 18%, transparent) 50%, transparent 70%), color-mix(in srgb, var(--muted) 10%, transparent); background-size: 220% 100%; animation: pg-shimmer 1.4s linear infinite; }
  @keyframes pg-shimmer { to { background-position: -120% 0; } }
  .pg-num { margin-top: 8px; font-size: .86rem; font-weight: 700; color: var(--muted); font-variant-numeric: tabular-nums; min-height: 1.2em; }
  .pg-thumb.changed { border-color: var(--accent); }
  .pg-thumb.changed .pg-num { color: var(--text); }
  .pg-was { font-size: .72rem; line-height: 1.3; color: var(--muted); min-height: 1.3em; }

  .pg-rot { display: grid; place-items: center; transition: transform .28s cubic-bezier(.2,.8,.2,1); }
  .pg-actions { display: flex; gap: 8px; margin-top: 8px; }
  .pg-actions button { display: grid; place-items: center; width: 36px; height: 32px; padding: 0; border-radius: 9px; cursor: pointer; color: var(--text);
    background: color-mix(in srgb, var(--muted) 12%, transparent); border: 1px solid var(--border); transition: background .15s ease, border-color .15s ease, transform .1s ease; }
  .pg-actions button:hover { background: color-mix(in srgb, var(--accent) 18%, transparent); border-color: var(--accent); }
  .pg-actions button:active { transform: scale(.94); }
  .pg-actions svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

  .pg-pick, .pg-img { cursor: pointer; }
  .pg-mark { position: absolute; inset: 0; display: grid; place-items: center; opacity: 0; transition: opacity .15s ease; pointer-events: none; }
  .pg-mark svg { width: 46px; height: 46px; padding: 11px; border-radius: 50%; fill: none; stroke: #fff; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; background: #d92d20; box-shadow: 0 4px 14px rgba(0,0,0,.35); }
  .pg-pick.del { border-color: #d92d20; background: color-mix(in srgb, #d92d20 10%, var(--card)); }
  .pg-pick.del .pg-slot { opacity: .35; filter: grayscale(1); }
  .pg-pick.del .pg-mark { opacity: 1; }
  .pg-pick.del .pg-num { color: #d92d20; text-decoration: line-through; }

  .pg-drag { cursor: grab; }
  .pg-drag:active { cursor: grabbing; }
  .pg-drag.dragging { opacity: .35; }
  .pg-drag.drop-before::before, .pg-drag.drop-after::after { content: ""; position: absolute; top: 6px; bottom: 6px; width: 4px; border-radius: 3px; background: var(--accent); }
  .pg-drag.drop-before::before { left: -11px; }
  .pg-drag.drop-after::after { right: -11px; }

  .pg-img .pg-tick { position: absolute; top: 4px; right: 4px; width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; background: var(--accent); color: var(--accent-text); opacity: 0; transform: scale(.6); transition: opacity .15s ease, transform .15s ease; }
  .pg-img .pg-tick svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; }
  .pg-img.sel { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 12%, var(--card)); }
  .pg-img.sel .pg-tick { opacity: 1; transform: none; }
  .pg-img .pg-slot canvas { max-width: 130px; max-height: 170px; }
  .pg-img .pg-dl { position: absolute; left: 6px; top: 6px; width: 30px; height: 30px; padding: 0; display: grid; place-items: center; border-radius: 8px; cursor: pointer; color: var(--text);
    background: color-mix(in srgb, var(--card) 88%, transparent); border: 1px solid var(--border); opacity: 0; transition: opacity .15s ease, background .15s ease; }
  .pg-img:hover .pg-dl, .pg-img:focus-within .pg-dl, .pg-img:focus .pg-dl { opacity: 1; }
  .pg-img .pg-dl:hover { background: var(--accent); color: var(--accent-text); border-color: var(--accent); }
  .pg-img .pg-dl svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
  .pg-grid.hide-small .pg-img.small { display: none; }
  @media (hover: none) { .pg-img .pg-dl { opacity: 1; } }
  @media (max-width: 520px) { .pg-grid { grid-template-columns: repeat(auto-fill, minmax(128px, 1fr)); gap: 12px; } .pg-ph { transform-origin: center; } }
  @media (prefers-reduced-motion: reduce) { .pg-rot, .pg-thumb { transition: none; } .pg-slot:empty { animation: none; } }
