.item-grant-dialog { box-sizing:border-box; width:min(34rem,94vw); max-height:88vh; overflow:auto; padding:1.15rem; border:1px solid var(--border,#425548); border-radius:12px; color:var(--text,#edf3ef); background:var(--panel,#142019); }
.item-grant-dialog::backdrop { background:#0009; }
.item-grant-dialog header,.item-grant-dialog .grant-actions,.item-grant-dialog li:has(button),.item-grant-dialog .grant-preview { display:flex; align-items:center; gap:.65rem; flex-wrap:wrap; }
.item-grant-dialog header,.item-grant-dialog li:has(button) { justify-content:space-between; }
.item-grant-dialog fieldset { display:grid; gap:.7rem; min-width:0; border:0; padding:0; margin:0; }
.item-grant-dialog label { display:grid; gap:.25rem; }
.item-grant-dialog input,.item-grant-dialog select { width:100%; max-width:100%; min-width:0; box-sizing:border-box; font:inherit; }
.item-grant-dialog :is(h2,h3,ul,ol) { margin:0; }
.item-grant-dialog ul { padding:0; }
.item-grant-dialog li { overflow-wrap:anywhere; margin-block:.25rem; }
.item-grant-dialog .grant-preview img { object-fit:contain; width:3rem; height:3rem; }
.item-grant-dialog { width:min(72rem,96vw); max-height:92dvh; }
.grant-categories,.grant-toolbar { display:flex; align-items:center; gap:.35rem; }
.grant-categories { flex-wrap:wrap; }
.grant-categories .btn { padding:.35rem .65rem; border-radius:3px; white-space:nowrap; }
.grant-categories [aria-pressed=true],.grant-tile[aria-pressed=true] { box-shadow:inset 0 0 0 2px rgb(var(--accent-rgb,74,222,128)); background:rgba(var(--accent-rgb,74,222,128),.18); }
.grant-toolbar input { flex:1; }
.grant-toolbar p { margin:0; font-size:.85rem; }
.grant-layout { display:grid; grid-template-columns:minmax(0,1fr) minmax(13rem,25%); gap:.9rem; }
.grant-shelf,.grant-detail { max-height:52dvh; overflow:auto; overscroll-behavior:contain; scrollbar-gutter:stable; padding:.3rem; }
.grant-grid { display:grid; grid-template-columns:repeat(auto-fill,minmax(5.8rem,1fr)); gap:.3rem; }
.grant-tile { min-width:0; display:grid; grid-template-columns:minmax(0,1fr); grid-template-rows:56px auto; align-content:start; gap:3px; box-sizing:border-box; height:auto; white-space:normal; align-items:center; justify-items:center; padding:.35rem; border-radius:3px; border:1px solid var(--border,#425548); background:rgba(145,150,146,.13); color:inherit; cursor:pointer; }
.grant-tile:hover,.grant-tile:focus-visible { outline:1px solid currentColor; outline-offset:-1px; }
.grant-tile img { width:3.5rem; height:3.5rem; object-fit:contain; }
html[lang] .item-grant-dialog .grant-grid .grant-tile > span:last-child {
 display:block; min-width:0; max-width:100%; font-size:.74rem; line-height:1.32;
 white-space:normal; word-break:normal; overflow-wrap:anywhere!important; text-align:center;
}
.item-grant-dialog .grant-layout > *, .item-grant-dialog fieldset > * { min-width:0; }
.item-grant-dialog .grant-detail :is(strong,code,li,button), .item-grant-dialog > p {
 min-width:0; max-width:100%; white-space:normal; overflow-wrap:anywhere!important;
}
.grant-detail { display:flex; flex-direction:column; gap:.6rem; border-left:1px solid var(--border,#425548); padding-inline-start:.8rem; }
.grant-detail>* { flex-shrink:0; }
.grant-detail code { overflow-wrap:anywhere; }
.grant-shelf>button { margin:.5rem auto; }
.grant-shelf>button[hidden] { display:none; }
@media(max-width:680px) {
 .grant-layout { grid-template-columns:minmax(0,1fr); }
 .grant-categories { flex-wrap:nowrap; overflow-x:auto; padding-bottom:.25rem; }
 .grant-categories button { flex:none; }
 .grant-shelf { max-height:35dvh; }
 .grant-grid { grid-template-columns:repeat(auto-fill,minmax(min(5.25rem,100%),1fr)); }
 .grant-detail { max-height:none; overflow:visible; border-left:0; border-top:1px solid var(--border,#425548); padding:.5rem 0 0; }
}

.item-grant-dialog .grant-icon { display:inline-block; width:56px; height:56px; flex:none; background-repeat:no-repeat; }

.item-grant-dialog .grant-bp { display:flex; align-items:center; gap:.45rem; cursor:pointer; }
.item-grant-dialog .grant-bp input { width:1rem; height:1rem; margin:0; }

.grant-kits summary { cursor:pointer; font-weight:600; }
.grant-kits > :not(summary) { margin-top:.45rem; }
.grant-kits small { display:block; }
