.token-library-content { padding:0 12px 12px; min-width:0; }
.token-library-heading { display:flex; align-items:center; justify-content:space-between; gap:8px; margin-bottom:12px; }
.token-library-heading > span { font-size:12px; color:var(--muted); }
.token-library-content > label { display:grid; gap:6px; margin-bottom:10px; font-size:12px; color:var(--muted); }
.token-library-content input,.token-library-content select,.token-editor input { width:100%; min-width:0; min-height:44px; }
.token-library-content button,.token-editor button { min-height:44px; }
.token-results { display:flex; align-items:center; justify-content:space-between; gap:4px; min-height:44px; }
.token-count { font-size:12px; color:var(--muted); }
.token-clear { font-size:12px; }
.token-placement-hint { font-size:11px; line-height:1.6; color:var(--muted); margin:2px 0 12px; }
.token-list { display:grid; grid-template-columns:repeat(auto-fill,minmax(min(116px,100%),1fr)); gap:8px; max-height:48vh; overflow:auto; padding:4px; margin:-4px; }
.token-entry { min-width:0; border:1px solid var(--line); border-radius:6px; overflow:hidden; background:var(--bg); }
.token-place { display:flex; flex-direction:column; width:100%; gap:8px; padding:8px; text-align:left; background:transparent; color:var(--text); border-radius:0; }
.token-place:not(:disabled):hover { background:var(--panel); }
.token-place:disabled { opacity:1; }
.token-place:focus-visible { outline-offset:-3px; }
.token-place img { width:100%; height:104px; object-fit:contain; border-radius:3px; background:#e8e3d210; }
.token-place span { width:100%; font-size:12px; line-height:1.4; overflow-wrap:anywhere; }
.token-entry-footer { display:flex; align-items:center; gap:4px; padding:0 8px; min-height:44px; }
.token-set-label { flex:1; min-width:0; font-size:10px; color:var(--muted); overflow-wrap:anywhere; }
.token-manage { flex-shrink:0; min-width:44px; padding:0; font-size:23px; letter-spacing:1px; }
.token-library-state { grid-column:1/-1; padding:20px 8px; font-size:13px; line-height:1.6; }
.token-state-detail { margin:6px 0 12px; font-size:12px; color:var(--muted); overflow-wrap:anywhere; }
.token-form { display:grid; gap:12px; margin:0; min-width:0; }
.token-editor { width:min(420px,calc(100vw - 24px)); max-height:calc(100dvh - 24px); padding:20px; overflow:auto; }
.token-editor h2 { font-family:Georgia,"Times New Roman",serif; font-size:24px; }
.token-editor-help { font-size:12px; line-height:1.6; color:var(--muted); }
.token-editor label { display:grid; gap:6px; font-size:12px; }
.token-preview { display:block; width:100%; height:160px; object-fit:contain; border-radius:5px; background:#e8e3d210; }
.token-editor-status { font-size:12px; color:var(--accent); overflow-wrap:anywhere; }
.token-editor-status:empty { display:none; }
.token-editor-actions { display:flex; flex-wrap:wrap; justify-content:flex-end; gap:8px; }
.token-delete-confirm { display:grid; gap:12px; font-size:12px; line-height:1.6; border-top:1px solid var(--line); padding-top:12px; }
.token-editor input[type=file] { font-size:11px; }
.token-editor input:focus-visible,.token-library-content input:focus-visible { outline:2px solid var(--accent); outline-offset:2px; }

.token-import { width:min(420px, calc(100vw - 32px)); max-height:calc(100dvh - 32px); overflow:auto; }
.token-import img { display:block; width:100%; height:160px; object-fit:contain; }
.token-import img[hidden] { display:none; }
.token-form select { width:100%; min-width:0; min-height:44px; }
.token-custom-size { display:grid; grid-template-columns:1fr 1fr; gap:12px; }
.token-custom-size[hidden] { display:none; }
.token-custom-size input { width:100%; min-width:0; min-height:44px; }
.token-size-help,.token-size-summary { font-size:12px; line-height:1.5; color:var(--muted); }
.token-grid-preview { max-width:100%; margin:auto; border:1px solid var(--line); background-color:#e8e3d210; background-image:linear-gradient(to right,#9b967955 1px,transparent 1px),linear-gradient(to bottom,#9b967955 1px,transparent 1px); background-size:var(--preview-cell) var(--preview-cell); }
.token-grid-preview img { display:block; width:100%; height:100%; object-fit:contain; background:none; border-radius:0; }
.token-grid-preview img[hidden] { display:none; }
#assets-panel .token-place img, #assets-panel .token-grid-preview { background-color:#e6d3b2; }
.token-import h2, .token-import p { margin:.25rem 0; }
.token-import-status { overflow-wrap:anywhere; }
.boards-panel { display:flex; align-items:end; flex-wrap:wrap; gap:.5rem; padding:.5rem; }
/* Translate before the animated scale so the ring stays centered throughout its pulse. */
.board-ping { position:absolute; width:44px; height:44px; border:2px solid #f6b847; border-radius:50%; translate:-50% -50%; pointer-events:none; z-index:40; animation:ping-pulse .7s ease-out 3; }
@keyframes ping-pulse { from { opacity:1; scale:.5; } to { opacity:0; scale:2; } }
@media(prefers-reduced-motion:reduce) { .board-ping { animation:none; } }
