.shared-attachment-picker.shared-attachment-picker{box-sizing:border-box;width:min(720px,calc(100% - 28px));max-height:min(720px,85dvh);padding:18px;border:1px solid #41474c;background:var(--surface-page);color:var(--text);border-radius:8px;overflow:hidden}
.shared-attachment-picker[open]{display:flex;flex-direction:column;gap:0}
.shared-attachment-picker::backdrop{background:#000b;-webkit-backdrop-filter:blur(5px);backdrop-filter:blur(5px)}
.shared-attachment-picker header button{padding:0;border:0;background:none;color:var(--accent);font:400 28px/1 Arial,sans-serif;box-shadow:none;cursor:pointer}
.shared-attachment-picker header{flex:none;gap:12px;margin:0 0 12px}
.shared-attachment-picker header h2{font:400 24px/1.1 var(--title);margin:0;color:var(--accent)}
.shared-attachment-picker input[type=search]{flex:none;width:100%;box-sizing:border-box;margin:0 0 10px;padding:10px;border:1px solid #3d4449;border-radius:0;background:var(--surface-panel);color:var(--text);font:400 16px/1.2 var(--mono)}
.shared-attachment-picker input[type=search]:focus:not(:focus-visible){outline:none;border-color:#3d4449;box-shadow:none}
.shared-attachment-picker #compare-attachment-options,.shared-attachment-picker #lab-options{flex:1 1 auto;min-height:0;max-height:none;overflow-y:auto;padding:0 3px 0 0}
.attachment-picker-controls{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,2fr);gap:8px;margin-bottom:8px}
.attachment-picker-controls.has-no-priorities{grid-template-columns:1fr}
.attachment-picker-base{display:flex;align-items:center;justify-content:center;gap:9px;min-width:0;min-height:75px;padding:9px;border:1px solid #30363b;background:var(--surface-panel);color:var(--text);cursor:pointer}
.attachment-picker-base img{width:36px;height:36px;object-fit:contain}
.attachment-picker-base strong{font:600 12px/1.3 var(--mono)}
.attachment-picker-best{min-width:0;padding:8px 10px;border:1px solid #30363b;background:var(--surface-panel)}
.attachment-picker-best-title{display:block;margin-bottom:6px;color:#9ba4aa;font:600 10px/1.2 var(--mono)}
.attachment-picker-priorities{display:flex;flex-wrap:wrap;gap:5px}
.attachment-picker-priority{min-height:28px;padding:5px 7px;border:1px solid #41474c;background:var(--surface-page);color:var(--text);font:500 10px/1.2 var(--mono);cursor:pointer}
.attachment-picker-option{display:grid;grid-template-columns:46px minmax(0,1fr) minmax(0,1.1fr);align-items:center;gap:10px;width:100%;box-sizing:border-box;margin:0 0 6px;padding:9px 10px;border:1px solid #30363b;background:var(--surface-panel);color:var(--text);text-align:left;cursor:pointer}
.attachment-picker-art{display:grid;place-items:center;min-width:0}
.attachment-picker-art img{display:block;width:44px;height:44px;object-fit:contain}
.attachment-picker-copy{min-width:0}
.attachment-picker-name{display:block;overflow-x:auto;white-space:nowrap;color:var(--accent);font:600 12px/1.25 var(--mono)}
.attachment-picker-unlock{display:block;margin-top:4px;color:#9ba4aa;font:400 10px/1.25 var(--mono)}
.attachment-picker-effects{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:6px 8px;min-width:0}
.attachment-picker-effect{display:flex;flex-direction:column;gap:3px;min-width:0}
.attachment-picker-effect small{color:#9ba4aa;font:400 9px/1.2 var(--mono)}
.attachment-picker-effect strong{color:var(--text);font:500 11px/1.2 var(--mono);white-space:nowrap}
.attachment-picker-unit{margin-left:3px;color:#9ba4aa;font-size:9px}
.attachment-picker-effect .is-benefit{color:#62cf7e}.attachment-picker-effect .is-penalty{color:#ff625b}
.attachment-picker-option[aria-pressed=true]{border-color:var(--accent);box-shadow:inset 2px 0 var(--accent)}
.attachment-picker-option:focus-visible,.attachment-picker-base:focus-visible,.attachment-picker-priority:focus-visible{outline:1px solid var(--accent);outline-offset:1px}
@media(hover:hover){.attachment-picker-option:hover,.attachment-picker-base:hover,.attachment-picker-priority:hover{border-color:var(--accent)}}
.attachment-picker-empty{padding:10px;color:var(--muted);font:400 12px/1.4 var(--mono)}
@media(max-width:760px){.shared-attachment-picker.shared-attachment-picker{padding:12px;max-height:88dvh}.shared-attachment-picker header h2{font-size:22px}.attachment-picker-controls{grid-template-columns:minmax(0,.8fr) minmax(0,1.5fr);gap:6px}.attachment-picker-base{gap:5px;padding:6px}.attachment-picker-base strong{font-size:10px}.attachment-picker-base img{width:28px;height:28px}.attachment-picker-best{padding:7px}.attachment-picker-priority{font-size:9px;padding:5px;min-height:30px}.attachment-picker-option{grid-template-columns:36px minmax(0,1fr);gap:5px 8px;padding:8px}.attachment-picker-art{grid-row:1/3}.attachment-picker-art img{width:34px;height:34px}.attachment-picker-name{font-size:12px}.attachment-picker-effects{grid-column:2;grid-template-columns:repeat(3,minmax(0,1fr));gap:5px 7px}.attachment-picker-effect{flex-direction:row;align-items:center;justify-content:space-between;gap:3px}.attachment-picker-effect small{font-size:8px}.attachment-picker-effect strong{font-size:10px}.attachment-picker-unit{font-size:8px;margin-left:2px}}
/* Pointer focus must not leave a selected attachment trigger highlighted. */
.weapon-compare-page .compare-attachment-cell:focus-within:not(:has(:focus-visible)){border-color:#3b4044}
.weapon-compare-page .compare-attachment-slot:focus:not(:focus-visible){outline:none}
@media(hover:none){.weapon-compare-page .compare-attachment-cell:hover:not(:has(:focus-visible)){border-color:#3b4044}.weapon-compare-page .compare-attachment-slot:hover:not(:focus-visible){border-color:#3b4044}}
.attachment-picker-current{margin-bottom:9px;padding-bottom:9px;border-bottom:1px solid #30363b}
.attachment-picker-current-title{display:block;margin-bottom:7px;color:#9ba4aa;font:600 10px/1.2 var(--mono)}
.attachment-picker-current-values{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:7px 10px}
.attachment-picker-current-stat{display:flex;flex-direction:column;gap:3px;min-width:0}
.attachment-picker-current-stat small{color:#9ba4aa;font:400 9px/1.2 var(--mono)}
.attachment-picker-current-stat strong{color:var(--accent);font:500 12px/1.25 var(--mono);overflow-wrap:anywhere}
@media(max-width:760px){.attachment-picker-current-values{grid-template-columns:repeat(2,minmax(0,1fr));gap:7px}.attachment-picker-current-stat strong{font-size:11px}.attachment-picker-current-stat small{font-size:8px}}

/* Keep all attachment selector scroll tracks discreet and dark. */
.shared-attachment-picker #compare-attachment-options,.shared-attachment-picker #lab-options,.shared-attachment-picker .attachment-picker-name{scrollbar-width:thin;scrollbar-color:#383e43 var(--surface-page)}
.shared-attachment-picker ::-webkit-scrollbar{width:7px;height:5px}
.shared-attachment-picker ::-webkit-scrollbar-track{background:var(--surface-page)}
.shared-attachment-picker ::-webkit-scrollbar-thumb{background:#383e43;border:2px solid var(--surface-page);border-radius:4px}
.shared-attachment-picker ::-webkit-scrollbar-thumb:hover{background:#495158}
.shared-attachment-picker ::-webkit-scrollbar-button{background:var(--surface-page)}
.shared-attachment-picker ::-webkit-scrollbar-corner{background:var(--surface-page)}

/* Separate each attachment value into a compact, readable dark cell. */
.shared-attachment-picker .attachment-picker-effects{gap:6px;align-items:stretch}
.shared-attachment-picker .attachment-picker-effect{box-sizing:border-box;flex-direction:column;align-items:center;justify-content:center;gap:4px;padding:7px 5px;background:var(--surface-page);border:1px solid #30363b;border-radius:4px;text-align:center}
.shared-attachment-picker .attachment-picker-effect small{font-size:10px;line-height:1.2}
.shared-attachment-picker .attachment-picker-effect strong{font-size:13px;line-height:1.2}
.shared-attachment-picker .attachment-picker-unit{font-size:10px}
@media(max-width:760px){
 .shared-attachment-picker .attachment-picker-effects{gap:5px}
 .shared-attachment-picker .attachment-picker-effect{padding:5px 3px;gap:3px}
 .shared-attachment-picker .attachment-picker-effect small{font-size:9px}
 .shared-attachment-picker .attachment-picker-effect strong{font-size:12px}
 .shared-attachment-picker .attachment-picker-unit{font-size:9px}
}

/* Current weapon values share the same cells in a more compact size. */
.shared-attachment-picker .attachment-picker-current-values{gap:5px}
.shared-attachment-picker .attachment-picker-current-stat{box-sizing:border-box;align-items:center;justify-content:center;gap:3px;padding:5px 4px;border:1px solid #30363b;border-radius:4px;background:var(--surface-page);text-align:center}
.shared-attachment-picker .attachment-picker-current-stat small{font-size:9px;line-height:1.2}
.shared-attachment-picker .attachment-picker-current-stat strong{font-size:12px;line-height:1.2}
@media(max-width:760px){.shared-attachment-picker .attachment-picker-current-values{grid-template-columns:repeat(3,minmax(0,1fr))}.shared-attachment-picker .attachment-picker-current-stat{padding:4px 3px}.shared-attachment-picker .attachment-picker-current-stat strong{font-size:11px}}

.shared-attachment-picker .attachment-picker-priority{color:var(--accent)}

/* Touch selectors keep a real, bounded list height instead of a zero flex basis. */
@media(max-width:1100px){
 .shared-attachment-picker.shared-attachment-picker[open]{height:min(780px,90vh);height:min(780px,90dvh);max-height:90dvh}
 .shared-attachment-picker .attachment-picker-option{grid-template-columns:48px minmax(0,1fr);gap:8px 10px;padding:10px}
 .shared-attachment-picker .attachment-picker-art{grid-column:1;grid-row:1}
 .shared-attachment-picker .attachment-picker-copy{grid-column:2;grid-row:1}
 .shared-attachment-picker .attachment-picker-effects{grid-column:1/-1;grid-row:2;grid-template-columns:repeat(3,minmax(0,1fr))}
 .shared-attachment-picker .attachment-picker-name{font-size:14px}
 .shared-attachment-picker .attachment-picker-unlock{font-size:11px}
 .shared-attachment-picker .attachment-picker-effect{padding:7px 5px}
 .shared-attachment-picker .attachment-picker-effect small{font-size:11px}
 .shared-attachment-picker .attachment-picker-effect strong{font-size:14px}
 .shared-attachment-picker .attachment-picker-priority{min-height:36px;font-size:11px}
}
.wardogs-ipad .shared-attachment-picker.shared-attachment-picker[open]{height:min(780px,90dvh);max-height:90dvh;padding:16px}
@media(max-width:760px){
 .shared-attachment-picker.shared-attachment-picker[open]{width:calc(100% - 20px);padding:10px}
 .shared-attachment-picker .attachment-picker-controls{grid-template-columns:minmax(0,.7fr) minmax(0,1.3fr);gap:7px}
 .shared-attachment-picker .attachment-picker-best{display:contents}
 .shared-attachment-picker .attachment-picker-current{grid-column:1/-1;grid-row:1;margin:0;padding:8px;border:1px solid #30363b;background:var(--surface-panel)}
 .shared-attachment-picker .attachment-picker-current-title{font-size:11px;margin-bottom:6px}
 .shared-attachment-picker .attachment-picker-current-values{grid-template-columns:repeat(3,minmax(0,1fr))}
 .shared-attachment-picker .attachment-picker-current-stat{padding:6px 4px}
 .shared-attachment-picker .attachment-picker-current-stat small{font-size:10px}
 .shared-attachment-picker .attachment-picker-current-stat strong{font-size:12px}
 .shared-attachment-picker .attachment-picker-base{grid-column:1;grid-row:2/4;min-height:44px;padding:7px}
 .shared-attachment-picker .attachment-picker-best-title{grid-column:2;grid-row:2;margin:2px 0 0;font-size:11px}
 .shared-attachment-picker .attachment-picker-priorities{grid-column:2;grid-row:3;gap:5px}
 .shared-attachment-picker .attachment-picker-priority{flex:1 1 72px;padding:6px 4px;font-size:10px;min-height:36px}
 .shared-attachment-picker .attachment-picker-controls.has-no-priorities .attachment-picker-base{grid-column:1/-1;grid-row:auto}
 .shared-attachment-picker .attachment-picker-art img{width:42px;height:42px}
 .shared-attachment-picker .attachment-picker-effect{padding:6px 4px;gap:4px}
}

/* Keep current weapon and priorities in view, with base as the first list item. */
.shared-attachment-picker .attachment-picker-controls{display:block;position:sticky;top:0;z-index:2;margin:0 0 8px;padding-bottom:6px;background:var(--surface-page)}
.shared-attachment-picker .attachment-picker-best{display:block;box-sizing:border-box;width:100%;padding:9px;border:1px solid #30363b;background:var(--surface-panel)}
.shared-attachment-picker .attachment-picker-current{margin:0 0 8px;padding:0 0 8px;border:0;border-bottom:1px solid #30363b;background:transparent}
.shared-attachment-picker .attachment-picker-priorities{display:flex;flex-wrap:wrap;gap:5px}
.shared-attachment-picker .attachment-picker-best-title{display:block;margin:0 0 6px}
.shared-attachment-picker .attachment-picker-option.attachment-picker-base{display:grid;grid-template-columns:46px minmax(0,1fr);min-height:58px;justify-content:initial;text-align:left;padding:9px 10px;gap:10px}
@media(max-width:760px){
 .shared-attachment-picker .attachment-picker-best{padding:8px}
 .shared-attachment-picker .attachment-picker-current-values{grid-template-columns:repeat(3,minmax(0,1fr))}
 .shared-attachment-picker .attachment-picker-priority{flex:1 1 90px}
 .shared-attachment-picker .attachment-picker-option.attachment-picker-base{grid-template-columns:48px minmax(0,1fr);min-height:58px;padding:10px}
}

.shared-attachment-picker .attachment-picker-best-title{text-align:center}
.shared-attachment-picker .attachment-picker-priorities{justify-content:center}
@media(max-width:760px){
 .shared-attachment-picker .attachment-picker-controls{padding-bottom:3px;margin-bottom:5px}
 .shared-attachment-picker .attachment-picker-best{padding:6px}
 .shared-attachment-picker .attachment-picker-current{margin-bottom:5px;padding-bottom:5px}
 .shared-attachment-picker .attachment-picker-current-title{font-size:9px;margin-bottom:4px}
 .shared-attachment-picker .attachment-picker-current-values{grid-template-columns:repeat(6,minmax(0,1fr));gap:3px}
 .shared-attachment-picker .attachment-picker-current-stat{padding:4px 2px;gap:2px}
 .shared-attachment-picker .attachment-picker-current-stat small{font-size:8px}
 .shared-attachment-picker .attachment-picker-current-stat strong{font-size:10px;white-space:normal}
 .shared-attachment-picker .attachment-picker-best-title{font-size:10px;margin-bottom:4px}
 .shared-attachment-picker .attachment-picker-priorities{gap:4px}
 .shared-attachment-picker .attachment-picker-priority{flex:0 1 auto;min-height:28px;font-size:9px;padding:5px 6px}
}

@media(max-width:760px){
 .shared-attachment-picker input[type=search]{font-size:12px}
 .shared-attachment-picker .attachment-picker-current{text-align:center}
 .shared-attachment-picker .attachment-picker-current-values{justify-content:center}
}

/* Open attachment dialogs must never leave their trigger highlighted. */
body:has(#compare-attachment-picker[open]) .compare-attachment-cell,
body:has(#compare-attachment-picker[open]) .compare-attachment-slot,
body:has(#lab-picker[open]) .lab-slot,
body:has(#lab-picker[open]) .lab-slot-cell{border-color:#3b4044!important;box-shadow:none!important;outline:none!important}
body:has(#compare-attachment-picker[open]) .compare-attachment-slot,
body:has(#lab-picker[open]) .lab-slot{background:var(--surface-page)!important}

.attachment-picker-priority-short{display:none}
@media(max-width:760px){.attachment-picker-priority-full{display:none}.attachment-picker-priority-short{display:inline}}
/* The shared modal itself must stay neutral, including touch-triggered focus. */
dialog.shared-attachment-picker,
dialog.shared-attachment-picker[open],
dialog.shared-attachment-picker:hover,
dialog.shared-attachment-picker:focus,
dialog.shared-attachment-picker:focus-visible,
dialog.shared-attachment-picker:focus-within{
 border-color:#41474c!important;
 outline:none!important;
 box-shadow:none!important;
 -webkit-tap-highlight-color:transparent;
}

/* Shared picker priorities and phone stat alignment. */
.shared-attachment-picker .attachment-picker-priority{font-weight:700}
@media(max-width:760px){
 html:not(.wardogs-ipad) .shared-attachment-picker .attachment-picker-current{text-align:center}
 html:not(.wardogs-ipad) .shared-attachment-picker .attachment-picker-current-stat{align-items:center;justify-content:center;text-align:center}
}

/* Center the actual stat tiles, including slots with fewer than six stats. */
@media(max-width:760px){
 html:not(.wardogs-ipad) .shared-attachment-picker .attachment-picker-current-values{display:flex;flex-wrap:wrap;justify-content:center;gap:3px}
 html:not(.wardogs-ipad) .shared-attachment-picker .attachment-picker-current-stat{flex:0 0 calc((100% - 15px)/6)}
}
